Skip to content

Commit a2e4a2c

Browse files
committed
Auto merge of #710 - AzureMarker:feature/automated-changelog, r=nikomatsakis
Automate the changelog Older versions without tags use "best-effort" commit hashes. The choice of changelog generation tool can be changed if requested. Fixes #665
2 parents 19b19a1 + 168c8b2 commit a2e4a2c

File tree

4 files changed

+477
-81
lines changed

4 files changed

+477
-81
lines changed

.github/workflows/publish.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,27 @@ jobs:
2828
with:
2929
crate: cargo-workspaces
3030

31+
- name: Install Node (for changelog generation)
32+
uses: actions/setup-node@v2
33+
with:
34+
node-version: 16
35+
3136
- name: Release
3237
env:
3338
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3439
shell: bash
3540
run: |
41+
# Update changelog
42+
npm install auto-changelog@2.2.1
43+
auto-changelog --output RELEASES.md \
44+
--starting-version v0.11.0 \
45+
--merge-pattern 'Auto merge of #(\d+) - .+\n\n(.+)' \
46+
--template releases-template.hbs
47+
3648
git config --global user.email "runner@gha.local"
3749
git config --global user.name "Github Action"
3850
cargo workspaces -v version -ay --force '*' --include-merged-tags --no-git-commit --exact patch
3951
export VERSION=$(cargo pkgid | sed -E 's/.*#(.*)/\1/g')
40-
sed -E -i '' $'s/(# Unreleased)/\\1\\\n\\\n# Release '"$VERSION/" RELEASES.md
4152
git commit -am "Release $VERSION"
4253
git tag "v$VERSION"
4354
cargo workspaces -v publish --from-git --skip-published

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ chalk-parse/src/parser.rs
1212

1313
## IDE files
1414
/.idea/
15+
16+
## Files used in changelog generation
17+
package.json
18+
package-lock.json
19+
node_modules

0 commit comments

Comments
 (0)