diff --git a/.github/workflows/nativeCompile.yml b/.github/workflows/build.yml similarity index 55% rename from .github/workflows/nativeCompile.yml rename to .github/workflows/build.yml index 7778697..2b44508 100644 --- a/.github/workflows/nativeCompile.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: GraalVM Native Image builds +name: Build, compile, and release both bt and st on: push: @@ -7,13 +7,47 @@ on: - '*' pull_request: branches: [ "main" ] + workflow_dispatch: permissions: contents: read jobs: - build: + build-java: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Set up JDK 21 + uses: actions/setup-java@v5 + with: + java-version: '21' + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + - name: Build with Gradle + run: ./gradlew build + - name: Collect artifacts + run: | + mkdir artifacts + cp $(find tools/[bs]t/ -name "[bs]t-*.jar") artifacts/ + - name: Upload bt artifact + uses: actions/upload-artifact@v7 + with: + name: build-artifacts + path: artifacts/bt*.jar + archive: false + if-no-files-found: error + - name: Upload st artifact + uses: actions/upload-artifact@v7 + with: + name: build-artifacts + path: artifacts/st*.jar + archive: false + if-no-files-found: error + + build-native: name: bt and st on ${{ matrix.os }}-${{ matrix.arch }} + needs: [build-java] runs-on: ${{ matrix.label }} strategy: matrix: @@ -37,36 +71,51 @@ jobs: arch: arm64 steps: - uses: actions/checkout@v7 - - uses: graalvm/setup-graalvm@v1 with: java-version: '21' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} native-image-job-reports: 'true' - - # Note that Graal v21 builds to the current architecture, and "--target" is not functional. - # Therefore, we try to find runners that fit our targets (see above). - name: Build 'bt' and 'st' run: ./gradlew nativeCompile env: # Needed for Windows; not an issue for other OSes GRADLE_OPTS: -Djava.io.tmpdir=${{ runner.temp }} - - name: Run CLTH tests if: ${{ matrix.os != 'windows' }} shell: bash run: ./scripts/run-clth-tests.sh - - name: Upload 'bt' binary uses: actions/upload-artifact@v7 with: name: bt-${{ matrix.os }}-${{ matrix.arch }} path: tools/bt/build/native/nativeCompile/bt* archive: false + if-no-files-found: error - name: Upload 'st' binary uses: actions/upload-artifact@v7 with: name: st-${{ matrix.os }}-${{ matrix.arch }} path: tools/st/build/native/nativeCompile/st* archive: false + if-no-files-found: error + + release: + name: Create draft release + if: github.ref_type == 'tag' + needs: [build-java, build-native] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v8 + with: + merge-multiple: true + - uses: softprops/action-gh-release@v3 + with: + draft: true + generate_release_notes: true + files: | + bt* + st* diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml deleted file mode 100644 index aa22beb..0000000 --- a/.github/workflows/gradle.yml +++ /dev/null @@ -1,54 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle - -name: Build bt and st - -on: - push: - branches: [ "main" ] - tags: - - '*' - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v7 - - name: Set up JDK 21 - uses: actions/setup-java@v5 - with: - java-version: '21' - distribution: 'temurin' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v6 - - name: Build with Gradle - run: ./gradlew build - - name: Collect artifacts - run: | - mkdir artifacts - cp $(find tools/ -name "bastools-*.jar" -not -name "bastools-*-plain.jar") artifacts/ - - name: Upload bt artifact - uses: actions/upload-artifact@v7 - with: - name: build-artifacts - path: artifacts/bastools-tools-bt*.jar - archive: false - if-no-files-found: error - - name: Upload st artifact - uses: actions/upload-artifact@v7 - with: - name: build-artifacts - path: artifacts/bastools-tools-st*.jar - archive: false - if-no-files-found: error diff --git a/tools/bt/build.gradle b/tools/bt/build.gradle index 64ef186..98470dd 100644 --- a/tools/bt/build.gradle +++ b/tools/bt/build.gradle @@ -31,6 +31,7 @@ processTestAot.configure { } bootJar { + archiveBaseName='bt' manifest { attributes( 'Implementation-Title': 'BT CLI', diff --git a/tools/st/build.gradle b/tools/st/build.gradle index 428456e..f4b645c 100644 --- a/tools/st/build.gradle +++ b/tools/st/build.gradle @@ -31,6 +31,7 @@ processTestAot.configure { } bootJar { + archiveBaseName='st' manifest { attributes( 'Implementation-Title': 'Shape Tools CLI',