diff --git a/.changeset/bump-to-v5.md b/.changeset/bump-to-v5.md new file mode 100644 index 0000000000..cbef708da2 --- /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 +--- + +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. 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