From a8c7052b85d0d100a0c5f44f5c6b5b7accbfbcbc Mon Sep 17 00:00:00 2001 From: Aggre Date: Fri, 20 Dec 2024 15:57:07 +0900 Subject: [PATCH] add automation for npm publish --- .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 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 00000000..87d6604c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +name: Publish + +on: + workflow_run: + workflows: ['Build'] + branches: [main] + types: + - completed + +jobs: + on-success: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + + strategy: + matrix: + node-version: [20.x] + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - name: yarn install, and build + run: | + corepack enable + yarn install + yarn run build + - uses: JS-DevTools/npm-publish@v3 + with: + token: ${{ secrets.NPM_TOKEN }}