Skip to content

Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.

release.sh: tag the built commit and push it before gh release create, refuse a dirty tree

Gauthier Piarrette2397c78d2380
diff --git a/Scripts/release.sh b/Scripts/release.sh
index f6506e8..52e39b0 100755
--- a/Scripts/release.sh
+++ b/Scripts/release.sh
@@ -8,6 +8,9 @@ VERSION="${1:?usage: release.sh <version> <summary> [notes.md]}"
SUMMARY="${2:?summary required}"
NOTES_FILE="${3:-}"
+# The tag below marks HEAD as the source of this build, so the tree must be clean.
+git diff-index --quiet HEAD -- || { echo "tracked files modified; commit before releasing" >&2; exit 1; }
+
Scripts/make-app.sh release "$VERSION"
ZIP="dist/Highball-$VERSION.zip"
ditto -c -k --keepParent dist/Highball.app "$ZIP"
@@ -66,6 +69,12 @@ codesign --sign "Developer ID Application: Gauthier PIARRETTE (B95M7DARU4)" --ti
xcrun notarytool submit "$DMG" --keychain-profile highball --wait
xcrun stapler staple "$DMG"
+# Tag the exact commit this build came from and push it BEFORE gh release create:
+# without an existing tag, gh tags the REMOTE default-branch head, which mislabeled
+# v0.7.8 (local fix commits weren't pushed yet, so the tag landed on the v0.7.7 commit).
+git tag "v$VERSION"
+git push origin HEAD "v$VERSION"
+
if [ -n "$NOTES_FILE" ]; then
gh release create "v$VERSION" "$ZIP" "$DMG" --latest --title "Highball $VERSION" --notes-file "$NOTES_FILE"
else