forked from zeta-chain/node
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1013 Bytes
/
publish-typescript.yaml
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
name: Publish Typescript to NPM
on:
workflow_dispatch:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install buf
run: |
curl -sSL https://github.com/bufbuild/buf/releases/download/v1.28.1/buf-Linux-x86_64 -o /usr/local/bin/buf
chmod +x /usr/local/bin/buf
- name: Generate
run: |
make typescript
- name: Set Version
working-directory: typescript
run: |
version=$(cat ../app/setup_handlers.go | grep "const releaseVersion" | cut -d ' ' -f4 | tr -d '"')
npm version ${version}
- name: Publish package on NPM 📦
run: npm publish
working-directory: typescript
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}