mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-19 00:15:43 +01:00
chore: use gitcliff changelog for release (#9289)
This is to reuse the gitcliff output for the release
This commit is contained in:
parent
140290a94b
commit
8045fbe13a
30
.github/workflows/publish-new-version.yaml
vendored
30
.github/workflows/publish-new-version.yaml
vendored
@ -27,7 +27,8 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
changelog: ${{ steps.generate_changelog.outputs.changelog }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [ 20.x ]
|
node-version: [ 20.x ]
|
||||||
@ -81,6 +82,19 @@ jobs:
|
|||||||
else
|
else
|
||||||
echo "No changes to CHANGELOG.md"
|
echo "No changes to CHANGELOG.md"
|
||||||
fi
|
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
|
- run: yarn install --immutable
|
||||||
env:
|
env:
|
||||||
YARN_ENABLE_SCRIPTS: false
|
YARN_ENABLE_SCRIPTS: false
|
||||||
@ -149,9 +163,17 @@ jobs:
|
|||||||
|
|
||||||
release-changelog: # TODO this changelog is different than the git-cliff one above
|
release-changelog: # TODO this changelog is different than the git-cliff one above
|
||||||
needs: build
|
needs: build
|
||||||
uses: ./.github/workflows/release_changelog.yml
|
runs-on: ubuntu-latest
|
||||||
with:
|
steps:
|
||||||
version: ${{ github.event.inputs.version }}
|
- 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:
|
update-version-checker:
|
||||||
needs: publish-docker
|
needs: publish-docker
|
||||||
|
32
.github/workflows/release_changelog.yml
vendored
32
.github/workflows/release_changelog.yml
vendored
@ -1,32 +0,0 @@
|
|||||||
name: 'Release changelog'
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
version:
|
|
||||||
description: "Which version number should we use for the release"
|
|
||||||
type: 'string'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
release:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: v${{ inputs.version }} # tag that should be created by the caller workflow
|
|
||||||
- name: Build changelog
|
|
||||||
id: github_release
|
|
||||||
uses: metcalfc/changelog-generator@v4.3.1
|
|
||||||
with:
|
|
||||||
myToken: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
base-ref: v${{ inputs.version }}
|
|
||||||
- name: Create release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
with:
|
|
||||||
tag_name: v${{ inputs.version }}
|
|
||||||
name: v${{ inputs.version }}
|
|
||||||
body: ${{ steps.github_release.outputs.changelog }}
|
|
||||||
prerelease: ${{ contains(inputs.version, 'beta') || contains(inputs.version, 'alpha') }}
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
|
|
Loading…
Reference in New Issue
Block a user