File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,9 @@ The release workflow will publish to npm with the `beta` tag.
4949
5050For maintaining older versions (e.g., v1.3.x while v1.4.x is latest):
5151
52- 1 . Create a version branch named ` v1.3.x-latest `
53- 2 . Tags pushed from this branch will also receive the ` latest ` npm tag
52+ 1 . Create a version branch named ` v1.3.x ` (or ` v1.4.x ` , etc.)
53+ 2 . Tags pushed from this branch will receive the version as the npm tag
54+ (e.g., ` v1.4.x ` publishes with tag ` 1.4 ` )
5455
5556## Notes
5657
@@ -66,5 +67,5 @@ For maintaining older versions (e.g., v1.3.x while v1.4.x is latest):
6667* All releases are triggered by pushing tags matching ` v* `
6768* The CI determines the npm tag based on:
6869 * Pre-release suffix in tag name (canary, beta, rc, next)
69- * Whether the commit is on ` main ` or a version branch (` v*.*.x-latest ` )
70+ * Whether the commit is on ` main ` or a version branch (` v*.*.x ` )
7071* Always ensure CI is green before creating release tags
Original file line number Diff line number Diff line change @@ -55,16 +55,16 @@ jobs:
5555 else
5656 # Check if the commit is on the main branch or a version branch
5757 git fetch origin main
58- CURRENT_BRANCH=$(git branch -r --contains "$GITHUB_SHA" | grep -E 'origin/(main|v[0-9]+\.[0-9]+\.x-latest )' | head -1 | sed 's/.*origin\///')
58+ CURRENT_BRANCH=$(git branch -r --contains "$GITHUB_SHA" | grep -E 'origin/(main|v[0-9]+\.[0-9]+\.x)' | head -1 | sed 's/.*origin\///')
5959
6060 if [[ "$CURRENT_BRANCH" == "main" ]]; then
6161 NPM_TAG="latest"
62- elif [[ "$CURRENT_BRANCH" =~ ^v[0-9]+\.[0-9]+\.x-latest $ ]]; then
63- # For version branches like v1.3.x-latest , v1.4.x-latest , use "latest" tag
64- NPM_TAG="latest "
62+ elif [[ "$CURRENT_BRANCH" =~ ^v( [0-9]+\.[0-9]+) \.x$ ]]; then
63+ # For version branches like v1.3.x, v1.4.x, use the version as npm tag
64+ NPM_TAG="${BASH_REMATCH[1]} "
6565 else
66- echo "The tagged commit is not on the main branch or a version branch (v*.*.x-latest )."
67- echo "::error ::Releases with the 'latest' npm tag must be on the main branch or a version branch."
66+ echo "The tagged commit is not on the main branch or a version branch (v*.*.x)."
67+ echo "::error ::Releases must be on the main branch or a version branch (v*.*.x) ."
6868 exit 1
6969 fi
7070 fi
You can’t perform that action at this time.
0 commit comments