-
Notifications
You must be signed in to change notification settings - Fork 64
47 lines (37 loc) · 1.07 KB
/
npm-publish.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
46
47
name: Publish to npm
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "yarn"
- name: Install dependencies
run: yarn install
- name: Install tsx
run: npm install -g tsx
- name: Install dependencies
working-directory: ./sdk
run: yarn install
- name: Get version from package.json
id: package_version
run: echo "PACKAGE_VERSION=$(jq -r '.version' ./sdk/package.json)" >> $GITHUB_ENV
- name: Use version
run: echo "SDK version is $PACKAGE_VERSION"
- name: Build
run: yarn generate:sdk
- name: Push to npm
working-directory: ./sdk
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}