You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/release.yml
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,8 +16,38 @@ env:
16
16
REGISTRY_IMAGE: cipherstash/proxy
17
17
18
18
jobs:
19
+
verify-release:
20
+
name: Verify release metadata
21
+
runs-on: ubuntu-latest
22
+
timeout-minutes: 5
23
+
steps:
24
+
- uses: actions/checkout@v4
25
+
26
+
# Only enforced for numbered releases. On push/PR/workflow_dispatch this
27
+
# job is a no-op so it can still gate the build matrix below.
28
+
- name: Check version + changelog match the release tag
29
+
if: github.event_name == 'release'
30
+
run: |
31
+
tag='${{ github.event.release.tag_name }}'
32
+
version="${tag#v}"
33
+
34
+
cargo_version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)"
35
+
if [ "$cargo_version" != "$version" ]; then
36
+
echo "::error::Cargo.toml workspace version ($cargo_version) does not match release tag $tag. Bump the version in a prepare-release PR before tagging."
37
+
exit 1
38
+
fi
39
+
40
+
# Fixed-string match so dots in the version aren't treated as regex wildcards.
41
+
if ! grep -qF "## [$version]" CHANGELOG.md; then
42
+
echo "::error::CHANGELOG.md has no '## [$version]' section. Add release notes in a prepare-release PR before tagging."
43
+
exit 1
44
+
fi
45
+
46
+
echo "OK: tag $tag matches Cargo.toml version and CHANGELOG has a [$version] section."
0 commit comments