Release the package automatically on push to main

This commit is contained in:
2026-11-27 12:41:35 -07:00
parent 7d9d2d6239
commit a302a0ed0b
3 changed files with 67 additions and 3 deletions
+11 -2
View File
@@ -38,8 +38,11 @@ OUT="$(mktemp -d)"
trap 'rm -rf "$OUT"' EXIT
echo "Building the package from main..."
# -C starts from a fresh source tree, so nothing from an earlier build gets in
(cd "$SELF" && PKGDEST="$OUT" makepkg --force --cleanbuild)
# -C starts from a fresh source tree, so nothing from an earlier build gets in.
# --nodeps: the package only copies files, so building doesn't need its
# runtime dependencies (gnome-shell), which the release workflow's container
# doesn't have.
(cd "$SELF" && PKGDEST="$OUT" makepkg --force --cleanbuild --nodeps)
PKG="$(find "$OUT" -maxdepth 1 -name '*.pkg.tar.zst' | head -n 1)"
if [ -z "$PKG" ]; then
@@ -57,6 +60,12 @@ case "$STATUS" in
echo "Released $(basename "$PKG"). CoreDesktop's next update installs it."
;;
409)
# The release workflow sets this: re-running it for a commit that's already
# released isn't a failure
if [ -n "${RELEASE_EXISTING_OK:-}" ]; then
echo "[$REPO] already has $(basename "$PKG"); nothing to do."
exit 0
fi
echo "[$REPO] already has this version. Commit and push a change to main to release a new one." >&2
exit 1
;;