Update publish_npm.yaml

Signed-off-by: zhanghengxin <812718649@qq.com>
This commit is contained in:
zhanghengxin 2023-05-24 11:14:22 +08:00 committed by GitHub
parent c931190c90
commit 4a6fcb04ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,6 +18,8 @@ jobs:
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: git describe --abbrev=0
- name: Get version
id: get_version
run: echo "VERSION=$( git describe --abbrev=0 )" >> $GITHUB_OUTPUT
@ -25,11 +27,11 @@ jobs:
id: get_commit_id
run: echo "COMMIT_ID=$( git rev-parse --short "$GITHUB_SHA" )" >> $GITHUB_OUTPUT
- run: $(echo "${{ steps.get_version.outputs.VERSION }}-${{ steps.get_version.outputs.COMMIT_ID }}")
- run: $(echo "${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}")
- name: Set version
run: |
sudo apt-get install jq
jq '.version="${{ steps.get_version.outputs.VERSION }}-${{ steps.get_version.outputs.COMMIT_ID }}"' package.json > package.json.new
jq '.version="${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}"' package.json > package.json.new
mv package.json.new package.json
- name: Generate SDK
run: |