-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (46 loc) · 1.48 KB
/
npm_release.yml
File metadata and controls
48 lines (46 loc) · 1.48 KB
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
48
name: npm Release
on:
workflow_call:
secrets:
API_TOKEN_GITHUB:
required: true
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
publish-npm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@v11.5.1
- name: Add Github Key
run: |
export GO111MODULE=on
export GOPRIVATE=github.com/IceWhaleTech
git config --global url."https://${{ secrets.API_TOKEN_GITHUB }}@github.com".insteadOf "https://github.com"
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Set version
run: |
sudo apt-get install jq
jq '.version="${{ steps.get_version.outputs.VERSION }}"' package.json > package.json.new
mv package.json.new package.json
- name: Update submodule
run: git submodule update --init --recursive
- name: Generate SDK
run: |
npm cache clean --force
npm install @openapitools/openapi-generator-cli -g
openapi-generator-cli version-manager set 7.12.0
- run: npm i
- run: npm run start
- name: npm publish
run: |
npm publish --access restricted --tag latest