chore: update release pipeline #6
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: Release | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'adopt-openj9' | |
| java-version: '23.0.2' | |
| - name: Build for distribution | |
| run: ./gradlew assembleDist | |
| - name: Generate changelog from previous version | |
| if: github.ref_type == 'tag' | |
| shell: bash -xeuo pipefail {0} | |
| run: | | |
| git fetch --tags --force | |
| current_release="${{ github.ref_name }}" | |
| prev_release=$((git tag | grep -e "^[0-9]*\.[0-9]*\.[0-9]*$" | grep -v "${current_release}" | sort --version-sort | tail -n1) || echo "main") | |
| (git log --oneline --format=%s ${prev_release}..${current_release} | grep -e '^\(feat\|fix\|refactor\|chore\):' || echo "minor fixes") > CHANGELOG.md | |
| - name: Archive build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-artifacts | |
| path: | | |
| build/distributions/*.zip | |
| build/libs/*.jar | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: github.ref_type == 'tag' | |
| with: | |
| body_path: CHANGELOG.md | |
| files: build/distributions/*.zip | |
| token: ${{ secrets.RELEASE_TOKEN }} |