-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (39 loc) · 1006 Bytes
/
on-tag.yml
File metadata and controls
52 lines (39 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Publish to npm
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 24
on:
push:
tags: ['*']
permissions:
id-token: write
contents: read
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Update npm
run: npm install -g npm@latest
- run: npm ci
- run: npm run lint
- run: npm run test
- run: npm run build
- name: Update version
run: npm version $GITHUB_REF_NAME --no-git-tag-version
- name: Publish to npm
run: |
VERSION=$(node -p "require('./package.json').version")
if [[ $VERSION == *-* ]]; then
TAG="next"
else
TAG="latest"
fi
npm publish --tag $TAG