From 915777b05e362630e0b5982047e77f28ccc9e233 Mon Sep 17 00:00:00 2001 From: seasonyuu Date: Thu, 12 Sep 2024 10:16:08 +0800 Subject: [PATCH] ci: add publish actions --- .github/workflows/publish-beta.yml | 27 +++++++++++++++++++++++++++ .github/workflows/publish-latest.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/publish-beta.yml create mode 100644 .github/workflows/publish-latest.yml diff --git a/.github/workflows/publish-beta.yml b/.github/workflows/publish-beta.yml new file mode 100644 index 0000000..6bb372b --- /dev/null +++ b/.github/workflows/publish-beta.yml @@ -0,0 +1,27 @@ +name: publish-beta + +on: + push: + tags: ['v*'] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '16.x' + - name: NPM config + run: | + npm config set //registry-lpm.listenai.com/:_password ${{ secrets.LPM_ZHUOBIN_TOKEN }} + npm config set //registry-lpm.listenai.com/:username zbzhao + npm config set //registry-lpm.listenai.com/:email zbzhao@listenai.com + npm config set //registry-lpm.listenai.com/:always-auth true + - run: npm install + - run: npm run prepack + # - run: npm publish --tag=beta --registry=https://registry-lpm.listenai.com + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} + tag: 'beta' \ No newline at end of file diff --git a/.github/workflows/publish-latest.yml b/.github/workflows/publish-latest.yml new file mode 100644 index 0000000..346e906 --- /dev/null +++ b/.github/workflows/publish-latest.yml @@ -0,0 +1,28 @@ +name: publish-latest + +on: + release: + types: [released] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: '16.x' + - name: NPM config + run: | + npm config set //registry-lpm.listenai.com/:_password ${{ secrets.LPM_ZHUOBIN_TOKEN }} + npm config set //registry-lpm.listenai.com/:username zbzhao + npm config set //registry-lpm.listenai.com/:email zbzhao@listenai.com + npm config set //registry-lpm.listenai.com/:always-auth true + npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} + - uses: battila7/get-version-action@v2 + id: get_version + - run: npm dist-tag add @listenai/uiohook-napi@${{ steps.get_version.outputs.version-without-v }} latest + - run: npm dist-tag add @listenai/uiohook-napi@${{ steps.get_version.outputs.version-without-v }} latest --registry=https://registry-lpm.listenai.com + + +