Skip to content

Commit 38b138e

Browse files
chore(ci): set up publish workflow
1 parent b9c6c54 commit 38b138e

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
branches:
44
- main
55
pull_request: {}
6+
workflow_call: {}
67

78
concurrency:
89
group: '${{ github.workflow }} - ${{ github.head_ref || github.ref }}'

.github/workflows/publish.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
workflow_dispatch: {}
3+
release:
4+
types:
5+
- published
6+
7+
jobs:
8+
check:
9+
uses: ./.github/workflows/ci.yml
10+
secrets: inherit
11+
12+
publish:
13+
needs: check
14+
15+
runs-on: ubuntu-latest
16+
17+
permissions:
18+
contents: read
19+
id-token: write
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: lts/*
29+
registry-url: 'https://registry.npmjs.com'
30+
check-latest: true
31+
- name: Setup Yarn
32+
run: corepack enable
33+
34+
- name: Install Packages
35+
run: yarn install
36+
37+
- name: Build
38+
run: yarn build
39+
40+
- name: Publish
41+
run: |
42+
npm install -g npm@latest
43+
npm publish --provenance --access public
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)