From 6f3e1243d1209ffb48e8454c3fc70968d5e2034c Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 14 Dec 2025 16:23:40 +0000 Subject: [PATCH] chore: prepare for v5.0.0-rc.1 release - Update VERSION to 5.0.0-rc.1 - Add prerelease detection to create-release workflow - Mark RC releases as prereleases on GitHub (not 'latest') - Update publish-docker workflow to skip :latest tag for RCs - Support -rc.N, -alpha.N, and -beta.N version suffixes --- .github/workflows/create-release.yml | 39 ++++++++++---- .github/workflows/publish-docker.yml | 80 +++++++++++++++++++++------- VERSION | 2 +- 3 files changed, 92 insertions(+), 29 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 5b11ed7..29050e6 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -39,9 +39,18 @@ jobs: fi TAG="v${VERSION}" fi + + # Detect if this is a prerelease (RC, alpha, beta) + IS_PRERELEASE="false" + if [[ "$VERSION" =~ -rc\.[0-9]+$ ]] || [[ "$VERSION" =~ -alpha\.[0-9]+$ ]] || [[ "$VERSION" =~ -beta\.[0-9]+$ ]]; then + IS_PRERELEASE="true" + echo "Detected prerelease version: ${VERSION}" + fi + echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "Version: ${VERSION}, Tag: ${TAG}" + echo "is_prerelease=${IS_PRERELEASE}" >> $GITHUB_OUTPUT + echo "Version: ${VERSION}, Tag: ${TAG}, Prerelease: ${IS_PRERELEASE}" version_guard: needs: extract_version @@ -366,12 +375,15 @@ jobs: # Tag must exist first - draft releases can't create tags (GitHub API limitation) # See: https://github.com/cli/cli/issues/11589 # Create as draft first so we can upload assets before publishing + IS_PRERELEASE="${{ needs.extract_version.outputs.is_prerelease }}" + RELEASE_JSON=$(gh api "repos/${{ github.repository }}/releases" \ -X POST \ -F tag_name="${TAG}" \ -F name="Pulse ${TAG}" \ -F body="$(cat $NOTES_FILE)" \ - -F draft=true) + -F draft=true \ + -F prerelease=${IS_PRERELEASE}) rm -f "$NOTES_FILE" @@ -435,14 +447,23 @@ jobs: TAG="${{ needs.extract_version.outputs.tag }}" RELEASE_ID="${{ steps.create_release.outputs.release_id }}" - echo "Publishing release ${TAG}..." + IS_PRERELEASE="${{ needs.extract_version.outputs.is_prerelease }}" + echo "Publishing release ${TAG} (prerelease: ${IS_PRERELEASE})..." - gh api "repos/${{ github.repository }}/releases/${RELEASE_ID}" \ - -X PATCH \ - -F draft=false \ - -F make_latest=true - - echo "✓ Release published as latest: ${TAG}" + # Only mark as latest if this is NOT a prerelease + if [ "$IS_PRERELEASE" = "true" ]; then + gh api "repos/${{ github.repository }}/releases/${RELEASE_ID}" \ + -X PATCH \ + -F draft=false \ + -F make_latest=false + echo "✓ Release published as prerelease: ${TAG}" + else + gh api "repos/${{ github.repository }}/releases/${RELEASE_ID}" \ + -X PATCH \ + -F draft=false \ + -F make_latest=true + echo "✓ Release published as latest: ${TAG}" + fi - name: Trigger Docker image publish continue-on-error: true # Non-fatal if dispatch fails diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 3806c52..eeaec83 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -28,9 +28,18 @@ jobs: run: | TAG="${{ github.event.release.tag_name || inputs.tag }}" VERSION="${TAG#v}" + + # Detect if this is a prerelease (RC, alpha, beta) + IS_PRERELEASE="false" + if [[ "$VERSION" =~ -rc\.[0-9]+$ ]] || [[ "$VERSION" =~ -alpha\.[0-9]+$ ]] || [[ "$VERSION" =~ -beta\.[0-9]+$ ]]; then + IS_PRERELEASE="true" + echo "Detected prerelease version - will NOT update :latest tag" + fi + echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "Publishing Docker images for ${TAG}" + echo "is_prerelease=${IS_PRERELEASE}" >> $GITHUB_OUTPUT + echo "Publishing Docker images for ${TAG} (prerelease: ${IS_PRERELEASE})" - name: Log in to Docker Hub uses: docker/login-action@v3 @@ -75,36 +84,69 @@ jobs: return 1 } + IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}" + echo "Copying pulse staging image to final tags..." - retry_push "docker buildx imagetools create \ - --tag rcourtman/pulse:${TAG} \ - --tag rcourtman/pulse:${VERSION} \ - --tag rcourtman/pulse:latest \ - --tag ghcr.io/${{ github.repository_owner }}/pulse:${TAG} \ - --tag ghcr.io/${{ github.repository_owner }}/pulse:${VERSION} \ - --tag ghcr.io/${{ github.repository_owner }}/pulse:latest \ - ghcr.io/${{ github.repository_owner }}/pulse:${STAGING_TAG}" + if [ "$IS_PRERELEASE" = "true" ]; then + # For prereleases, only tag with version - do NOT update :latest + retry_push "docker buildx imagetools create \ + --tag rcourtman/pulse:${TAG} \ + --tag rcourtman/pulse:${VERSION} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse:${TAG} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse:${VERSION} \ + ghcr.io/${{ github.repository_owner }}/pulse:${STAGING_TAG}" + else + # For stable releases, also update :latest + retry_push "docker buildx imagetools create \ + --tag rcourtman/pulse:${TAG} \ + --tag rcourtman/pulse:${VERSION} \ + --tag rcourtman/pulse:latest \ + --tag ghcr.io/${{ github.repository_owner }}/pulse:${TAG} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse:${VERSION} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse:latest \ + ghcr.io/${{ github.repository_owner }}/pulse:${STAGING_TAG}" + fi echo "Copying pulse-docker-agent staging image to final tags..." - retry_push "docker buildx imagetools create \ - --tag rcourtman/pulse-docker-agent:${TAG} \ - --tag rcourtman/pulse-docker-agent:${VERSION} \ - --tag rcourtman/pulse-docker-agent:latest \ - --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${TAG} \ - --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${VERSION} \ - --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:latest \ - ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${STAGING_TAG}" + if [ "$IS_PRERELEASE" = "true" ]; then + # For prereleases, only tag with version - do NOT update :latest + retry_push "docker buildx imagetools create \ + --tag rcourtman/pulse-docker-agent:${TAG} \ + --tag rcourtman/pulse-docker-agent:${VERSION} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${TAG} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${VERSION} \ + ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${STAGING_TAG}" + else + # For stable releases, also update :latest + retry_push "docker buildx imagetools create \ + --tag rcourtman/pulse-docker-agent:${TAG} \ + --tag rcourtman/pulse-docker-agent:${VERSION} \ + --tag rcourtman/pulse-docker-agent:latest \ + --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${TAG} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${VERSION} \ + --tag ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:latest \ + ghcr.io/${{ github.repository_owner }}/pulse-docker-agent:${STAGING_TAG}" + fi - name: Output image information run: | + IS_PRERELEASE="${{ steps.version.outputs.is_prerelease }}" echo "✅ Docker images published successfully!" echo "" echo "Server images:" echo " - rcourtman/pulse:${{ steps.version.outputs.tag }}" echo " - rcourtman/pulse:${{ steps.version.outputs.version }}" - echo " - rcourtman/pulse:latest" + if [ "$IS_PRERELEASE" != "true" ]; then + echo " - rcourtman/pulse:latest" + fi echo "" echo "Agent images:" echo " - rcourtman/pulse-docker-agent:${{ steps.version.outputs.tag }}" echo " - rcourtman/pulse-docker-agent:${{ steps.version.outputs.version }}" - echo " - rcourtman/pulse-docker-agent:latest" + if [ "$IS_PRERELEASE" != "true" ]; then + echo " - rcourtman/pulse-docker-agent:latest" + fi + echo "" + if [ "$IS_PRERELEASE" = "true" ]; then + echo "Note: :latest tags were NOT updated (this is a prerelease)" + fi diff --git a/VERSION b/VERSION index c4207ac..3882c27 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.36.2 +5.0.0-rc.1