File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 6767 id : npm-tag
6868 run : |
6969 VERSION=$(node -p "require('./package.json').version")
70+ # Check if this is a beta release
7071 if [[ "$VERSION" == *"-beta"* ]]; then
7172 echo "tag=--tag beta" >> $GITHUB_OUTPUT
73+ # Check if this release is from a non-main branch (patch/maintenance release)
74+ elif [[ "${{ github.event.release.target_commitish }}" != "main" ]]; then
75+ # Use "release-X.Y" as tag for old branch releases (e.g., "release-1.23" for 1.23.x)
76+ # npm tags are mutable pointers to versions (like "latest" pointing to 1.24.3).
77+ # Using "release-1.23" means users can `npm install @modelcontextprotocol/sdk@release-1.23`
78+ # to get the latest patch on that minor version, and the tag updates if we
79+ # release 1.23.2, 1.23.3, etc.
80+ # Note: Can't use "v1.23" because npm rejects tags that look like semver ranges.
81+ MAJOR_MINOR=$(echo "$VERSION" | cut -d. -f1,2)
82+ echo "tag=--tag release-${MAJOR_MINOR}" >> $GITHUB_OUTPUT
7283 else
7384 echo "tag=" >> $GITHUB_OUTPUT
7485 fi
You can’t perform that action at this time.
0 commit comments