File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 44 release :
55 types :
66 - published
7-
7+ - released
88jobs :
9+ # When a prerelease is promoted to a full release, update the npm latest tag
10+ promote :
11+ if : github.event.action == 'released'
12+ runs-on : ubuntu-24.04
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v6
16+ - name : Install node 20
17+ uses : actions/setup-node@v6
18+ with :
19+ node-version : ' 20'
20+ registry-url : https://registry.npmjs.org
21+ - name : Promote edge to latest
22+ run : |
23+ VERSION=$(echo "$TAG_NAME" | sed 's/^v//')
24+ PACKAGE=$(node -p "require('./package.json').name")
25+ npm dist-tag add "$PACKAGE@$VERSION" latest
26+ echo "::notice title=Promoted $VERSION to latest::The latest tag now points to $VERSION (was edge-only)"
27+ env :
28+ TAG_NAME : ${{ github.event.release.tag_name }}
29+ NODE_AUTH_TOKEN : ${{secrets.NPM_DEPLOY_TOKEN}}
30+
931 deploy :
32+ if : github.event.action == 'published'
1033 runs-on : ${{ matrix.os }}
1134 env :
1235 TERM : xterm
You can’t perform that action at this time.
0 commit comments