Skip to content

Commit 064f71f

Browse files
committed
perma-changelog
1 parent 1ddfc69 commit 064f71f

File tree

2 files changed

+13
-34
lines changed

2 files changed

+13
-34
lines changed

.github/workflows/rust-release.yml

Lines changed: 13 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,25 @@ jobs:
4242
- uses: actions/checkout@v4
4343
with:
4444
fetch-depth: 0
45-
- name: Install release-plz
45+
- name: Install release tools
4646
uses: taiki-e/install-action@v2
4747
with:
48-
tool: release-plz
48+
tool: release-plz, git-cliff
4949
- name: Run release-plz
5050
working-directory: ./rust/main
5151
env:
5252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353
run: |
5454
git config user.name "github-actions[bot]"
5555
git config user.email "github-actions[bot]@users.noreply.github.com"
56+
57+
# Generate updated CHANGELOG.md before running release-plz
58+
git-cliff --config cliff.toml --tag-pattern "agents-v*" -o CHANGELOG.md
59+
60+
# Stage CHANGELOG.md so release-plz includes it in the release PR
61+
git add CHANGELOG.md
62+
63+
# Run release-plz to create/update the release PR
5664
release-plz release-pr --git-token "$GITHUB_TOKEN"
5765
- name: Summary
5866
if: always()
@@ -107,17 +115,11 @@ jobs:
107115
echo "should_release=false" >> $GITHUB_OUTPUT
108116
fi
109117
fi
110-
- uses: dtolnay/rust-toolchain@stable
111-
if: steps.check_version.outputs.should_release == true
112-
- uses: actions/cache@v4
113-
if: steps.check_version.outputs.should_release == true
114-
with:
115-
path: ~/.cargo/registry/index
116-
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }}
117-
restore-keys: cargo-registry-
118118
- name: Install git-cliff
119119
if: steps.check_version.outputs.should_release == true
120-
run: cargo install git-cliff --locked
120+
uses: taiki-e/install-action@v2
121+
with:
122+
tool: git-cliff
121123
- name: Determine version and create release
122124
if: steps.check_version.outputs.should_release == true
123125
working-directory: ./rust/main
@@ -189,21 +191,3 @@ jobs:
189191
[ "$IS_PRERELEASE" = "true" ] && echo "This is marked as a pre-release on GitHub." >> $GITHUB_STEP_SUMMARY
190192
echo "" >> $GITHUB_STEP_SUMMARY
191193
echo "Binary artifacts will be built automatically by the agent-release-artifacts workflow." >> $GITHUB_STEP_SUMMARY
192-
- name: Update CHANGELOG.md
193-
if: steps.check_version.outputs.should_release == true
194-
working-directory: ./rust/main
195-
env:
196-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
197-
run: |
198-
# Generate full changelog from all tags
199-
git-cliff --config cliff.toml --tag-pattern "agents-v*" -o CHANGELOG.md
200-
201-
# Commit and push the updated changelog
202-
git add CHANGELOG.md
203-
if git diff --staged --quiet; then
204-
echo "No changes to CHANGELOG.md"
205-
else
206-
git commit -m "chore: update CHANGELOG.md for $(git describe --tags --abbrev=0)"
207-
git push origin main
208-
echo "CHANGELOG.md updated and pushed to main" >> $GITHUB_STEP_SUMMARY
209-
fi

rust/main/release-plz.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,3 @@ pr_draft = false
1717
pr_labels = ["release"]
1818
# Automatically determine next version from conventional commits
1919
semver_check = false
20-
# Ignore generated test files and keys that may be present in CI
21-
git_allow_list = [
22-
"!**/chains/hyperlane-starknet/src/contracts/mod.rs",
23-
"!**/sealevel/environments/local-e2e/**/keys/*.json"
24-
]

0 commit comments

Comments
 (0)