fix: softprops/action-gh-release@v2 should use existing tag instead of creating a new tag

This commit is contained in:
Michael Bolin
2025-06-30 12:02:45 -07:00
parent 6dad5c3b17
commit f4a8893b52
2 changed files with 15 additions and 15 deletions
+1 -9
View File
@@ -28,19 +28,11 @@ else
VERSION=$(printf '0.0.%d' "$(date +%y%m%d%H%M)")
fi
TAG="rust-v$VERSION"
RELEASE_BRANCH="release/$TAG"
git checkout -b "$RELEASE_BRANCH"
git checkout -b "$TAG"
perl -i -pe "s/^version = \".*\"/version = \"$VERSION\"/" Cargo.toml
git add Cargo.toml
git commit -m "Release $VERSION"
git tag -a "$TAG" -m "Release $VERSION"
# The commit identified by the tag must be reachable from a branch so that
# when GitHub creates the `Source code (tar.gz)` for the release, it can find
# the commit. This is a requirement for Homebrew to be able to install the
# package from the tarball.
git push origin "$RELEASE_BRANCH"
git push origin "refs/tags/$TAG"
git checkout "$CURRENT_BRANCH"