Commit 744475d 1 parent 5d8d662 commit 744475d Copy full SHA for 744475d
File tree 1 file changed +28
-28
lines changed
1 file changed +28
-28
lines changed Original file line number Diff line number Diff line change 1
- # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name : Node.js Package
1
+ name : Publish package to registries
5
2
6
3
on :
7
- workflow_dispatch :
8
4
release :
9
5
types : [created]
10
6
7
+ # Allows you to run this workflow manually from the Actions tab
8
+ workflow_dispatch :
9
+
10
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11
+ permissions :
12
+ contents : read
13
+ pages : write
14
+ id-token : write
15
+
11
16
jobs :
12
- publish-npm :
17
+ deploy :
13
18
runs-on : ubuntu-latest
14
19
steps :
15
20
- uses : actions/checkout@v4
16
- - uses : actions/setup-node@v4
21
+ - name : Use Node.js ${{ matrix.node-version }}
22
+ uses : actions/setup-node@v4
17
23
with :
18
- node-version : 21
19
- registry-url : https://registry.npmjs.org/
24
+ node-version : 21.x
25
+ registry-url : " https://registry.npmjs.org"
26
+ cache : " npm"
20
27
- run : npm ci
21
- - run : npm run build
28
+ - run : npm run build --if-present
29
+ - run : |
30
+ cp jsr.json jsr.json.old
31
+ jq ".version = \"${TAG_NAME}\"" jsr.json.old > jsr.json
32
+ rm jsr.json.old
33
+ env:
34
+ TAG_NAME: ${{ github.event.release.tag_name }}
35
+ - run : npx jsr publish --allow-dirty --allow-slow-types
36
+ - run : npm version ${TAG_NAME} --git-tag-version=false
37
+ env :
38
+ TAG_NAME : ${{ github.event.release.tag_name }}
22
39
- run : npm publish
23
40
env :
24
- NODE_AUTH_TOKEN : ${{secrets.npm_token}}
25
-
26
- publish-jsr :
27
- runs-on : ubuntu-latest
28
-
29
- permissions :
30
- contents : read
31
- id-token : write
32
-
33
- steps :
34
- - uses : actions/checkout@v4
35
- - uses : actions/setup-node@v4
36
- with :
37
- node-version : 21
38
- registry-url : https://registry.npmjs.org/
39
- - run : npm ci
40
- - run : npm run build
41
- - run : npx jsr publish
41
+ NODE_AUTH_TOKEN : ${{ secrets.npm_token }}
You can’t perform that action at this time.
0 commit comments