CasaOS - A simple, easy-to-use, elegant open-source Personal Cloud system.
Update publish_npm.yaml (#1120)
李旭海c5de0319fbec
diff --git a/.github/workflows/publish_npm.yaml b/.github/workflows/publish_npm.yamlindex de4c139..434084e 100644--- a/.github/workflows/publish_npm.yaml+++ b/.github/workflows/publish_npm.yaml@@ -14,25 +14,33 @@ jobs:runs-on: ubuntu-22.04steps:- uses: actions/checkout@v3+ with:+ fetch-depth: 0- uses: actions/setup-node@v3with:node-version: 16registry-url: https://registry.npmjs.org/++ - run: git tag --sort=-creatordate | head -n 1- name: Get versionid: get_version- run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}+ run: echo "VERSION=$(git tag --sort=-creatordate | head -n 1)" >> $GITHUB_OUTPUT+ - name: Get commit id+ 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_commit_id.outputs.COMMIT_ID }}"- name: Set versionrun: |sudo apt-get install jq- jq '.version="${{ steps.get_version.outputs.VERSION }}"' package.json > package.json.new+ jq '.version="${{ steps.get_version.outputs.VERSION }}-${{ steps.get_commit_id.outputs.COMMIT_ID }}"' package.json > package.json.newmv package.json.new package.json- name: Generate SDKrun: |npm cache clean --forcenpm install @openapitools/openapi-generator-cli -g- make build- run: npm i- run: npm run start- - run: npm publish -W+ - run: npm publish --access publicenv:NODE_AUTH_TOKEN: ${{secrets.npm_token}}diff --git a/package.json b/package.jsonindex b0ba851..704442c 100644--- a/package.json+++ b/package.json@@ -1,6 +1,7 @@{"name": "@icewhale/casaos-openapi","version": "0.0.1",+"scripts": {"clean": "rm -rf generate","build": "rm -rf dist && tsc && yarn clean",@@ -35,4 +36,4 @@},"author": "casaos","license": "Apache-2.0"-}\ No newline at end of file+}