-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (42 loc) · 1.35 KB
/
Copy pathpublish.yml
File metadata and controls
44 lines (42 loc) · 1.35 KB
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
name: Publish to NPM
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: 22.x
registry-url: https://registry.npmjs.org
cache: yarn
- run: yarn install --immutable
- run: yarn install --immutable
working-directory: ./jsx-runtime
- run: yarn build
working-directory: ./jsx-runtime
- run: |
echo "npmAuthToken: $NODE_AUTH_TOKEN" >> ./.yarnrc.yml
yarn npm publish --access public --provenance --tolerate-republish
working-directory: ./jsx-runtime/dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: yarn build
- run: |
actual_version="$(jq -r '.version' package.json)"
if [ "$actual_version" != "${GITHUB_REF#refs/tags/v}" ]; then
echo "Expected package.json to have version ${GITHUB_REF#refs/tags/v}, got $actual_version"
exit 1
fi
- run: |
echo "npmAuthToken: $NODE_AUTH_TOKEN" >> ./.yarnrc.yml
yarn npm publish --access public --provenance
working-directory: ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}