File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to npm
2+
3+ on :
4+ push :
5+ tags :
6+ - " v[0-9]+.[0-9]+.[0-9]+"
7+ - " v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+ timeout-minutes : 10
13+ steps :
14+ - name : Checkout code
15+ uses : actions/checkout@v4
16+
17+ - name : Set up Node.js
18+ uses : actions/setup-node@v4
19+ with :
20+ node-version : 24
21+ cache : npm
22+ registry-url : " https://registry.npmjs.org/"
23+
24+ - name : Determine pre-release tag
25+ run : |
26+ TAG_NAME=${GITHUB_REF#refs/tags/}
27+ echo "Detected tag: $TAG_NAME"
28+ if [[ "$TAG_NAME" == *-alpha.* ]]; then
29+ echo "tag=alpha" >> $GITHUB_ENV
30+ else
31+ echo "tag=latest" >> $GITHUB_ENV
32+ fi
33+
34+ - name : Install dependencies
35+ run : npm ci
36+
37+ - name : Run tests
38+ run : npm test
39+
40+ - name : Build
41+ run : npm run build
42+
43+ - name : Publish
44+ run : npm publish --access public --tag ${{ env.tag }}
45+ env :
46+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments