Create new release #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create new release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag for the release (e.g., 1.0.0)' | |
| required: true | |
| default: '0.0.0' | |
| draft-release: | |
| description: 'Should this release be a draft?' | |
| type: boolean | |
| required: false | |
| default: true | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest, macos-latest ] | |
| include: | |
| - os: ubuntu-latest | |
| graalvm-home: /usr/lib/graalvm | |
| - os: macos-latest | |
| graalvm-home: /Library/Java/JavaVirtualMachines/graalvm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup GraalVM | |
| uses: graalvm/setup-graalvm@v1 | |
| with: | |
| java-version: '17.0.12' | |
| distribution: 'graalvm' | |
| #github-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build native executable | |
| env: | |
| VERSION_TAG: ${{ github.event.inputs.tag }} | |
| run: ./gradlew nativeImage -Pversion="$VERSION_TAG" | |
| - name: Upload native executable | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: native-executable-${{ matrix.os }} | |
| path: build/native-image/fern-junit-client* | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Make artifacts executable | |
| run: chmod +x artifacts/native-executable-* | |
| - name: Create GitHub Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/** | |
| generate_release_notes: true | |
| tag_name: 'v${{ github.event.inputs.tag }}' | |
| make_latest: true | |
| draft: "${{ github.event.inputs.draft-release }}" | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Add release URL to job summary | |
| if: success() | |
| run: | | |
| echo "Release URL: ${{ steps.create_release.outputs.url }}" | |
| echo "Release URL: ${{ steps.create_release.outputs.url }}" >> $GITHUB_STEP_SUMMARY |