Release the package automatically on push to main
This commit is contained in:
@@ -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
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user