Merge pull request #291 from AikidoSec/make-release-workflow-trigger-… #67
Workflow file for this run
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: 📦 Publish new Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| extract-version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.get_version.outputs.version }} | |
| steps: | |
| - name: Extract version from tag | |
| id: get_version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Version: $VERSION" | |
| build: | |
| needs: extract-version | |
| runs-on: open-source-releaser | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set the version for this release | |
| run: make replace_version version=${{ needs.extract-version.outputs.version }} | |
| - name: Set up JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'adopt' | |
| - name: Download binaries & Build with Gradle | |
| run: chmod +x gradlew && make binaries && make build | |
| - name: Create zip and tar.gz files of the build | |
| run: | | |
| mv dist/ zen/ | |
| zip -r zen.zip zen/* | |
| tar -czf zen.tar.gz zen/* | |
| - name: Generate SHA checksums | |
| run: | | |
| shasum -a 256 zen.zip > zen.zip.sha256sum | |
| shasum -a 256 zen.tar.gz > zen.tar.gz.sha256sum | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-artifacts | |
| path: | | |
| zen.zip | |
| zen.zip.sha256sum | |
| zen.tar.gz | |
| zen.tar.gz.sha256sum | |
| release: | |
| needs: [extract-version, build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-artifacts | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 | |
| with: | |
| draft: true | |
| files: | | |
| zen.zip | |
| zen.zip.sha256sum | |
| zen.tar.gz | |
| zen.tar.gz.sha256sum | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |