From c3cc6371240e4d484f8dea650ffd285a495eb264 Mon Sep 17 00:00:00 2001 From: Peter Wielander Date: Mon, 6 Apr 2026 13:56:12 -0700 Subject: [PATCH 1/2] Support dual-branch releases and bump to v5 beta - Add `stable` to release workflow trigger branches - Make npm dist-tag conditional: `stable` gets `latest`, `main` keeps `beta` - Make GitHub release flags branch-aware: stable = latest, main = prerelease - Add major changeset to bump workflow + @workflow/core to 5.0.0-beta.0 Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Peter Wielander --- .changeset/bump-to-v5.md | 30 ++++++++++++++++++++++++++++ .github/workflows/release.yml | 37 +++++++++++++++++++++++++---------- 2 files changed, 57 insertions(+), 10 deletions(-) create mode 100644 .changeset/bump-to-v5.md diff --git a/.changeset/bump-to-v5.md b/.changeset/bump-to-v5.md new file mode 100644 index 0000000000..b3d27cbfc9 --- /dev/null +++ b/.changeset/bump-to-v5.md @@ -0,0 +1,30 @@ +--- +"workflow": major +"@workflow/core": major +"@workflow/ai": major +"@workflow/astro": major +"@workflow/builders": major +"@workflow/cli": major +"@workflow/errors": major +"@workflow/nest": major +"@workflow/next": major +"@workflow/nitro": major +"@workflow/nuxt": major +"@workflow/rollup": major +"@workflow/serde": major +"@workflow/sveltekit": major +"@workflow/swc-plugin": major +"@workflow/typescript-plugin": major +"@workflow/utils": major +"@workflow/vite": major +"@workflow/vitest": major +"@workflow/web": major +"@workflow/web-shared": major +"@workflow/world": major +"@workflow/world-local": major +"@workflow/world-postgres": major +"@workflow/world-testing": major +"@workflow/world-vercel": major +--- + +**BREAKING CHANGE**: Bump all packages to v5 for next development cycle diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 842f57de78..956f877412 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - stable concurrency: ${{ github.workflow }}-${{ github.ref }} @@ -66,21 +67,28 @@ jobs: env: GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} - - name: Add latest dist-tag to published packages + - name: Manage npm dist-tags for published packages if: steps.changesets.outputs.published == 'true' env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }} run: | FAILED=0 + BRANCH="${GITHUB_REF_NAME}" - # Parse published packages and add latest tag to each while IFS= read -r pkg; do NAME=$(echo "$pkg" | jq -r '.name') VERSION=$(echo "$pkg" | jq -r '.version') - echo "Adding 'latest' dist-tag to ${NAME}@${VERSION}..." - if ! npm dist-tag add "${NAME}@${VERSION}" latest; then - echo "::error::Failed to add 'latest' dist-tag to ${NAME}@${VERSION}" - FAILED=1 + + if [ "$BRANCH" = "stable" ]; then + # GA releases from stable get the 'latest' dist-tag + echo "Adding 'latest' dist-tag to ${NAME}@${VERSION}..." + if ! npm dist-tag add "${NAME}@${VERSION}" latest; then + echo "::error::Failed to add 'latest' dist-tag to ${NAME}@${VERSION}" + FAILED=1 + fi + else + # Pre-release versions from main already get the 'beta' tag from changeset publish + echo "Skipping 'latest' dist-tag for pre-release ${NAME}@${VERSION} (published with 'beta' tag by changesets)" fi done < <(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -c '.[]') @@ -100,22 +108,31 @@ jobs: TITLE=$(echo "$RELEASE_JSON" | jq -r '.title') BODY=$(echo "$RELEASE_JSON" | jq -r '.body') + # Determine release flags based on branch + if [ "$GITHUB_REF_NAME" = "stable" ]; then + PRERELEASE="false" + LATEST_FLAG="--latest" + else + PRERELEASE="true" + LATEST_FLAG="--latest=false" + fi + # Check if a release with this tag already exists if gh release view "$TAG" &>/dev/null; then echo "Release $TAG already exists, updating..." gh release edit "$TAG" \ --title "$TITLE" \ --notes "$BODY" \ - --latest \ - --prerelease=false + $LATEST_FLAG \ + --prerelease=$PRERELEASE else echo "Creating new release $TAG..." gh release create "$TAG" \ --target "${{ github.sha }}" \ --title "$TITLE" \ --notes "$BODY" \ - --latest \ - --prerelease=false + $LATEST_FLAG \ + --prerelease=$PRERELEASE fi - name: Post release notes to Slack From 3262e51b64521dc39cdab8c1913240f86988850e Mon Sep 17 00:00:00 2001 From: Peter Wielander Date: Mon, 6 Apr 2026 14:00:02 -0700 Subject: [PATCH 2/2] Apply suggestion from @VaguelySerious Signed-off-by: Peter Wielander --- .changeset/bump-to-v5.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/bump-to-v5.md b/.changeset/bump-to-v5.md index b3d27cbfc9..cbef708da2 100644 --- a/.changeset/bump-to-v5.md +++ b/.changeset/bump-to-v5.md @@ -27,4 +27,4 @@ "@workflow/world-vercel": major --- -**BREAKING CHANGE**: Bump all packages to v5 for next development cycle +Bump all packages to `5.0.0-beta.1` for next development cycle. Beta versions may be breaking even on patch changes. Upgrade only if you want to test experimental features.