-
Notifications
You must be signed in to change notification settings - Fork 156
45 lines (37 loc) · 1.01 KB
/
publish-sdk.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
33
34
35
36
37
38
39
40
41
42
43
44
45
name: "Publish SDK"
on:
release:
types: [published]
jobs:
publish:
name: Publish SDK
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/sdk
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
always-auth: true
node-version: 16.x
registry-url: https://registry.npmjs.org
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: true
- name: Build code
run: pnpm build
- name: Bump version
run: pnpm bump-version
- name: Publish
run: |
diff <(npx npm info . --json | jq '."dist-tags".latest') <(cat package.json | jq '.version') || (pnpm publish --no-git-checks --access public)
env:
NPM_TOKEN: ${{ secrets.NODE_TOKEN }}