Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Python Wheel

on:
workflow_call:
inputs:
ref:
description: Git ref to check out
required: false
type: string
default: ""

jobs:
build-wheel:
name: Build Python wheel
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0
ref: ${{ inputs.ref || github.ref }}

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build and test
run: ./gradlew clean build buildPythonWheel

- name: Collect wheel
run: |
mkdir -p dist
find . -path "*/build/install/*/dist/*.whl" -exec cp {} dist/ \;

- name: Upload Python wheel artifact
uses: actions/upload-artifact@v4
with:
name: python-wheel
path: dist/*.whl
if-no-files-found: error
retention-days: 14
31 changes: 7 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,18 @@ on:
permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
build-wheel:
name: Build and test
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Set up Java
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build and test
run: ./gradlew clean build
uses: ./.github/workflows/build-wheel.yml

dependency-submission:
name: Submit Gradle dependencies
needs: build
needs: build-wheel
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
release:
types:
- published

permissions:
contents: write
actions: read

concurrency:
group: release-${{ github.event.release.id }}
cancel-in-progress: false

jobs:
build-wheel:
name: Build wheel from release tag
uses: ./.github/workflows/build-wheel.yml
with:
ref: ${{ github.event.release.tag_name }}

publish-wheel:
name: Publish Python wheel to GitHub Release
needs: build-wheel
runs-on: ubuntu-latest

steps:
- name: Download Python wheel artifact
uses: actions/download-artifact@v4
with:
name: python-wheel
path: dist

- name: Generate checksums
run: |
cd dist
sha256sum *.whl > SHA256SUMS.txt

- name: Publish wheel to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
dist/*.whl
dist/SHA256SUMS.txt
Loading