Skip to content

Commit 7a6fac9

Browse files
committed
add action
1 parent 96bcf2b commit 7a6fac9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/publish_npm.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: publish npm
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
publish-npm:
14+
runs-on: ubuntu-22.04
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: 16
20+
registry-url: https://registry.npmjs.org/
21+
- name: Get version
22+
id: get_version
23+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
24+
- name: Set version
25+
run: |
26+
sudo apt install jq
27+
jq '.version="${{ steps.get_version.outputs.VERSION }}"' package.json > package.json.new
28+
mv package.json.new package.json
29+
- name: Generate SDK
30+
run: |
31+
npm cache clean --force
32+
npm install @openapitools/openapi-generator-cli -g
33+
make build
34+
- run: bash generate-npm.sh
35+
env:
36+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)