Skip to content

Commit

Permalink
chore: use gitcliff changelog for release (#9289)
Browse files Browse the repository at this point in the history
This is to reuse the gitcliff output for the release
  • Loading branch information
gastonfournier authored Feb 11, 2025
1 parent 140290a commit 8045fbe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 36 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/publish-new-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest

outputs:
changelog: ${{ steps.generate_changelog.outputs.changelog }}
strategy:
matrix:
node-version: [ 20.x ]
Expand Down Expand Up @@ -81,6 +82,19 @@ jobs:
else
echo "No changes to CHANGELOG.md"
fi
- name: Output changelong from ${{ env.PREV }}
continue-on-error: true
id: generate_changelog
if: ${{ !contains(github.event.inputs.version, '-') }}
env:
PREV: ${{ env.PREV }}
run: |
# Run git-cliff again and capture its output in a variable
changelog=$(git-cliff $PREV..HEAD --tag v${{ github.event.inputs.version }})
# Set the changelog as an output for the step using the new GITHUB_OUTPUT file
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$changelog" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- run: yarn install --immutable
env:
YARN_ENABLE_SCRIPTS: false
Expand Down Expand Up @@ -149,9 +163,17 @@ jobs:

release-changelog: # TODO this changelog is different than the git-cliff one above
needs: build
uses: ./.github/workflows/release_changelog.yml
with:
version: ${{ github.event.inputs.version }}
runs-on: ubuntu-latest
steps:
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.version }}
name: v${{ inputs.version }}
body: ${{ needs.build.outputs.changelog }}
prerelease: ${{ contains(inputs.version, 'beta') || contains(inputs.version, 'alpha') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}

update-version-checker:
needs: publish-docker
Expand Down
32 changes: 0 additions & 32 deletions .github/workflows/release_changelog.yml

This file was deleted.

0 comments on commit 8045fbe

Please sign in to comment.