Release #14
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: | |
| workflow_dispatch: | |
| inputs: | |
| major_minor: | |
| description: "Major/Minor version" | |
| required: true | |
| default: "0.6" | |
| jobs: | |
| build-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Calculate Version String | |
| run: | | |
| COMMITS=$(git rev-list --count --all || echo 0) | |
| VERSION=v${{ github.event.inputs.major_minor }}.${COMMITS} | |
| echo RELEASE_TAG=${VERSION} >> $GITHUB_ENV | |
| - name: Generate Changelog | |
| id: build_changelog | |
| uses: mikepenz/release-changelog-builder-action@v6 | |
| with: | |
| configuration: ".github/release-changelog-config.json" | |
| toTag: ${{ github.ref_name }} | |
| mode: "HYBRID" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Clean up changelog | |
| id: process_log | |
| run: | | |
| echo "${{ steps.build_changelog.outputs.changelog }}" > changelog.md | |
| # Add a full changelog link at the bottom of changelog | |
| COMPARE_LINK="**Full Changelog**: https://github.com/${{ github.repository }}/compare/${{ steps.build_changelog.outputs.fromTag }}...${{ env.RELEASE_TAG }}" | |
| # Combine output | |
| echo "final_body<<EOF" >> $GITHUB_OUTPUT | |
| cat changelog.md >> $GITHUB_OUTPUT | |
| echo -e "\n" >> $GITHUB_OUTPUT | |
| echo "$COMPARE_LINK" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| name: ${{ env.RELEASE_TAG }} | |
| body: ${{ steps.process_log.outputs.final_body }} | |
| prerelease: ${{ github.ref_name != 'main' }} | |
| make_latest: ${{ github.ref_name == 'main' && 'true' || 'false' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |