main
1name: JSR Manual Publish
2
3on:
4 workflow_dispatch:
5
6permissions: {}
7
8jobs:
9 build:
10 runs-on: ubuntu-latest
11 steps:
12 - uses: actions/checkout@v5
13 with:
14 persist-credentials: false
15 - uses: actions/setup-node@v5
16 with:
17 node-version: 24
18 cache: 'npm'
19 - run: npm ci
20 - run: npm test
21 env:
22 FORCE_COLOR: 3
23 - uses: actions/upload-artifact@v4
24 with:
25 name: build-${{ github.run_id }}
26 path: |
27 build
28 jsr.json
29 retention-days: 1
30
31 jsr-publish:
32 needs: build
33 runs-on: ubuntu-latest
34 permissions:
35 contents: read
36 id-token: write
37 steps:
38 - uses: actions/checkout@v5
39 with:
40 persist-credentials: false
41 - uses: actions/setup-node@v5
42 with:
43 node-version: 24
44 cache: 'npm'
45 - uses: actions/download-artifact@v5
46 with:
47 name: build-${{ github.run_id }}
48
49 - name: Get zx version info
50 run: |
51 echo SHA_SHORT=$(git rev-parse --short HEAD) >> $GITHUB_ENV
52 echo ZX_VERSION=$(jq -r '.version' jsr.json) >> $GITHUB_ENV
53
54 - name: pushing to jsr.io
55 run: |
56 cat <<< $(jq '.version="${{ env.ZX_VERSION }}-dev.${{ env.SHA_SHORT }}"' jsr.json) > jsr.json
57 npx jsr publish --allow-dirty