Skip to content

Commit

Permalink
ci: generate changelog for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanccn committed May 11, 2024
1 parent 8ad2c21 commit c1fce66
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
uses: ./.github/workflows/build.yml

crates-io:
name: Publish to crates.io
name: crates.io
needs: build

runs-on: ubuntu-latest
Expand All @@ -35,7 +35,7 @@ jobs:
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_API_TOKEN }}

github:
name: Make GitHub release
name: GitHub Releases
needs: build

runs-on: ubuntu-latest
Expand All @@ -47,6 +47,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install git-cliff
uses: taiki-e/install-action@git-cliff

- name: Download artifacts
id: download
uses: actions/download-artifact@v4
Expand All @@ -64,14 +67,13 @@ jobs:
basename "$artifact" | \
xargs -I {} zip -jr "$asset_path"/{}.zip "$artifact"
done
echo "asset-path=$asset_path" >> "$GITHUB_OUTPUT"
- name: Generate changelog
run: git-cliff -o /tmp/changelog.md -l --strip all

- name: Create release
env:
ASSETS: ${{ steps.prepare.outputs.asset-path }}
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
run: |
gh release create \
--draft --notes-from-tag --verify-tag \
"$TAG" "$ASSETS"/*.zip
gh release create --notes-file /tmp/changelog.md --draft --verify-tag "$TAG" /tmp/assets/*.zip

0 comments on commit c1fce66

Please sign in to comment.