Skip to content

Commit

Permalink
chore(cd): set the changelog as release body
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Jun 19, 2021
1 parent e0cda23 commit 66dfbf4
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@main
with:
fetch-depth: 0
- name: Set the release version
shell: bash
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
Expand Down Expand Up @@ -90,6 +92,23 @@ jobs:
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --pinentry-mode=loopback \
--passphrase-fd 0 --detach-sign \
git-cliff-${{ env.RELEASE_VERSION }}-${{ matrix.TARGET }}.tar.gz
- name: Generate a changelog
uses: orhun/git-cliff-action@v1
id: git-cliff
with:
config: cliff.toml
args: --verbose --latest --strip header
env:
OUTPUT: CHANGES.md
- name: Set release body
id: release
shell: bash
run: |
r=$(cat ${{ steps.git-cliff.outputs.changelog }})
r="${r//'%'/'%25'}"
r="${r//$'\n'/'%0A'}"
r="${r//$'\r'/'%0D'}"
echo "::set-output name=RELEASE_BODY::$r"
- name: Upload the release
uses: svenstaro/upload-release-action@v2
with:
Expand All @@ -99,7 +118,7 @@ jobs:
tag: ${{ github.ref }}
release_name: "Release ${{ github.ref }}"
overwrite: true
body: "git-cliff release v${{ env.RELEASE_VERSION }}"
body: ${{ steps.release.outputs.RELEASE_BODY }}

publish-docker:
name: Publish the Docker image
Expand Down

0 comments on commit 66dfbf4

Please sign in to comment.