From b45dc73086cc8467f4d22e0cdd66190442d3bfb8 Mon Sep 17 00:00:00 2001 From: Arthas <15215604969@163.com> Date: Sun, 29 Jan 2023 15:50:08 +0800 Subject: [PATCH] Create publish.yml --- .github/workflows/publish.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..b6bc5e533 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: Publish to NPM +run-name: ${{ github.actor }} triggered this job +on: + workflow_dispatch: + inputs: + increment: + description: 'Increment "major", "minor", "patch", or "pre*" version; or specify version [default: "patch"]' + required: true + default: 'patch' + type: string + dry-run: + description: 'Do not touch or write anything, but show the commands' + default: true + type: boolean + +jobs: + release-it: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: '16' + - run: yarn + + - name: Setup NPM auth token + run: | + npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }} + + - if: ${{ inputs.dry-run }} + run: | + yarn release ${{ inputs.increment }} -d --ci + + - if: ${{ !inputs.dry-run }} + run: | + yarn release ${{ inputs.increment }} --ci