From d05ffc8cf3ccc43d6ebb42152c497d17e50bc994 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Wed, 15 Jul 2026 00:00:01 +0800 Subject: [PATCH] fix: publish alpha server releases as prereleases --- scripts/publish-github-release.sh | 10 +++++++--- scripts/test-publish-github-release.sh | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/publish-github-release.sh b/scripts/publish-github-release.sh index 2494706..9788022 100755 --- a/scripts/publish-github-release.sh +++ b/scripts/publish-github-release.sh @@ -62,12 +62,16 @@ fi if "$GH_BIN" release view "$VERSION" --repo "$REPOSITORY" >/dev/null 2>&1; then "$GH_BIN" release upload "$VERSION" "${ASSETS[@]}" --repo "$REPOSITORY" --clobber else + RELEASE_OPTIONS=(--generate-notes --verify-tag) + if [[ "$VERSION" == *-* ]]; then + RELEASE_OPTIONS+=(--prerelease) + else + RELEASE_OPTIONS+=(--latest) + fi "$GH_BIN" release create "$VERSION" "${ASSETS[@]}" \ --repo "$REPOSITORY" \ --title "Verstak Sync Server $VERSION" \ - --generate-notes \ - --latest \ - --verify-tag + "${RELEASE_OPTIONS[@]}" fi echo "GitHub release:" diff --git a/scripts/test-publish-github-release.sh b/scripts/test-publish-github-release.sh index 9eb8101..d91a7fb 100755 --- a/scripts/test-publish-github-release.sh +++ b/scripts/test-publish-github-release.sh @@ -87,6 +87,11 @@ grep -Fqx "push:origin:refs/tags/$VERSION" "$LOG" grep -F "release create $VERSION" "$LOG" >/dev/null grep -F "$ASSET_NAME" "$LOG" >/dev/null grep -F "SHA256SUMS" "$LOG" >/dev/null +grep -F -- "--prerelease" "$LOG" >/dev/null +if grep -F -- "--latest" "$LOG" >/dev/null; then + echo "alpha release was incorrectly marked latest" >&2 + exit 1 +fi if grep -F "$STALE_ASSET" "$LOG" >/dev/null; then echo "publisher uploaded an archive from a different release version" >&2 exit 1