-
-
Notifications
You must be signed in to change notification settings - Fork 7
32 lines (32 loc) · 943 Bytes
/
release.yml
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
name: Publish Package to npmjs
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Read .node-version
id: node-version
run: echo "node-version=$(cat .node-version)" >> $GITHUB_OUTPUT
- name: corepack enable
run: corepack enable
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
cache: yarn
node-version: ${{ steps.node-version.outputs.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn version ${{ github.event.release.name }}
- run: yarn run build
- run: yarn pack
- run: npm publish package.tgz --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}