From 3847bbdaba71fe79bfebbbd31c198b086250722d Mon Sep 17 00:00:00 2001 From: Sanghyeon Sim <96258104+halfmoon-mind@users.noreply.github.com> Date: Mon, 21 Aug 2023 19:11:40 +0900 Subject: [PATCH] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 41 +++++++++++++++++-------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 863d83b..b738d23 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -1,28 +1,31 @@ -name: Publish npm package +name: Node.js Package on: release: - types: [created] + types: [created] jobs: build: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '16' # Using Node.js v16 - - - name: Install dependencies - run: npm install + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - run: npm ci + - run: npm test - - name: Run build script - run: npm run build # Compiles your source code - - - name: Publish to npm - run: npm publish - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm run build + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}