From f4fab2593f53e1532c59ae9d8d164e0b80605220 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 30 Oct 2025 11:19:12 -0400 Subject: [PATCH] fix: allow prerelease tags (alpha/beta/rc) in deployment workflow Modified version validation to support testing with prerelease tags: - Prerelease tags (e.g., 1.1.0-alpha.1) now validate base version against package.json/manifest.json - Production tags still require exact version match - Supports -alpha.N, -beta.N, and -rc.N tag formats This enables deployment testing with alpha releases while maintaining strict version control for production releases. --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b6fbae..bb46c39 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,15 +27,33 @@ jobs: echo "package.json: $PKG_VERSION" echo "manifest.json: $MANIFEST_VERSION" - if [ "$TAG_VERSION" != "$PKG_VERSION" ] || [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then - echo "❌ Version mismatch detected!" - echo "Git tag: $TAG_VERSION" - echo "package.json: $PKG_VERSION" - echo "manifest.json: $MANIFEST_VERSION" - exit 1 - fi + # Check if this is a prerelease tag (alpha, beta, rc) + if [[ "$TAG_VERSION" =~ -alpha\. ]] || [[ "$TAG_VERSION" =~ -beta\. ]] || [[ "$TAG_VERSION" =~ -rc\. ]]; then + # For prerelease tags, strip the prerelease suffix and compare base version + BASE_VERSION="${TAG_VERSION%%-*}" + echo "Prerelease tag detected. Base version: $BASE_VERSION" - echo "✅ All versions match: $TAG_VERSION" + if [ "$BASE_VERSION" != "$PKG_VERSION" ] || [ "$BASE_VERSION" != "$MANIFEST_VERSION" ]; then + echo "❌ Base version mismatch detected!" + echo "Git tag base: $BASE_VERSION (from $TAG_VERSION)" + echo "package.json: $PKG_VERSION" + echo "manifest.json: $MANIFEST_VERSION" + exit 1 + fi + + echo "✅ Base versions match: $BASE_VERSION (prerelease: $TAG_VERSION)" + else + # For production releases, require exact match + if [ "$TAG_VERSION" != "$PKG_VERSION" ] || [ "$TAG_VERSION" != "$MANIFEST_VERSION" ]; then + echo "❌ Version mismatch detected!" + echo "Git tag: $TAG_VERSION" + echo "package.json: $PKG_VERSION" + echo "manifest.json: $MANIFEST_VERSION" + exit 1 + fi + + echo "✅ All versions match: $TAG_VERSION" + fi - name: Setup Node.js uses: actions/setup-node@v4