Skip to content

Commit

Permalink
CI: create release changelog automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Apr 23, 2024
1 parent f44c631 commit c2a72b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release-upload.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ jobs:
name: "Create Release"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # We need the repo to execute extract-changelog.sh below
- uses: actions/download-artifact@v4
with:
name: cardano-cli-linux # Should match (2)
Expand All @@ -186,6 +187,10 @@ jobs:
long_tag=${{ needs.wait_for_hydra.outputs.TARGET_TAG }}
short_tag="${long_tag#cardano-cli-}"
echo "SHORT_TAG=$short_tag" >> "$GITHUB_ENV"
- name: Create changelog
run: |
echo -e "# Changelog\n" > RELEASE_CHANGELOG.md
./scripts/ci/extract-changelog.sh ${{ env.SHORT_TAG }} >> RELEASE_CHANGELOG.md
- name: Create Release
uses: input-output-hk/action-gh-release@v1
if: ${{ needs.wait_for_hydra.outputs.DRY_RUN == 'false' }}
Expand All @@ -199,3 +204,4 @@ jobs:
# All entries in 'files' below should match (3)
files: |
${{ needs.wait_for_hydra.outputs.TARGET_TAG }}-linux.tar.gz
body_path: RELEASE_CHANGELOG.md
4 changes: 4 additions & 0 deletions scripts/ci/extract-changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,8 @@ NUMBER_OF_LINES=$((NUMBER_OF_LINES - 1))
# Uncomment to debug
# echo "Found number of lines: $NUMBER_OF_LINES"

# Piping tail doesn't play nice with "set -o pipefail" so turning it off
# See https://superuser.com/questions/554855/how-can-i-fix-a-broken-pipe-error
set +o pipefail

tail -n "+$CHANGELOG_START_LINE" "$CHANGELOG" | head -n "$NUMBER_OF_LINES"

0 comments on commit c2a72b0

Please sign in to comment.