Skip to content

Commit a439595

Browse files
fix: stabilize release version detection
1 parent e50b364 commit a439595

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,16 @@ jobs:
8484
# Generate changelog and bump version
8585
cog bump --auto
8686
87-
# Get the new version
88-
NEW_VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
87+
# Get the new version from the newly created tag
88+
NEW_TAG=$(git describe --tags --abbrev=0)
89+
NEW_VERSION=${NEW_TAG#v}
8990
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
9091
9192
# Generate changelog for the release
92-
cog changelog --at "v${NEW_VERSION}" > RELEASE_NOTES.md
93+
cog changelog --at "${NEW_TAG}" > RELEASE_NOTES.md
9394
9495
# Create GitHub release
95-
gh release create "v${NEW_VERSION}" \
96+
gh release create "${NEW_TAG}" \
9697
--title "Release v${NEW_VERSION}" \
9798
--notes-file RELEASE_NOTES.md \
9899
--draft=false \

0 commit comments

Comments
 (0)