Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .github/actions/verify-tag-version/action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Verify tag version
description: >
Check that the pushed tag is the expected prefix followed by exactly the
version about to be published, refusing to publish on any mismatch.
Check that the pushed tag is the expected prefix followed by the version
about to be published, refusing to publish on any mismatch. Tags carry
the full `{version}+payjoin-{version}` string; when the packed version
has no build metadata (npm, PyPI, and NuGet artifacts cannot carry it),
the tag's metadata is stripped before comparing.
inputs:
tag-prefix:
description: Expected tag prefix, e.g. payjoin-csharp-
Expand Down Expand Up @@ -30,8 +33,16 @@ runs:
exit 1
fi
tag_version="${TAG#"$PREFIX"}"
if [[ $tag_version != "$VERSION" ]]; then
echo "::error::tag $TAG implies version $tag_version but the packed version is $VERSION; refusing to publish"
compare_version="$tag_version"
# A packed version without build metadata comes from a registry
# that cannot represent it, so the tag is compared with its
# metadata stripped; a packed version that carries metadata must
# match the tag exactly.
if [[ $VERSION != *+* ]]; then
compare_version="${tag_version%%+*}"
fi
Comment on lines +36 to +43

@spacebear21 spacebear21 Aug 25, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit clunky but it seemed like the most straightforward way to enforce uniformity across tags (payjoin-{lang}-{version}+payjoin-{version}) despite some package managers not supporting the + syntax.

Open to suggestions for better ways to structure the release tags. The current approach took inspiration from https://gitlab.com/ark-bitcoin/bark-ffi-bindings/-/blob/master/RELEASE.md?ref_type=heads#versioning-per-language

if [[ $compare_version != "$VERSION" ]]; then
echo "::error::tag $TAG implies version $compare_version but the packed version is $VERSION; refusing to publish"
exit 1
fi
echo "version=$tag_version" >>"$GITHUB_OUTPUT"