From 37f1cf22b0547ba8f787450f073f3ce3f0227920 Mon Sep 17 00:00:00 2001 From: yuhanas yulianto Date: Tue, 9 Aug 2022 12:25:17 +0700 Subject: [PATCH] chore(workflows): add publish workflow --- .github/workflows/main.yml | 3 --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5c8e73..920d714 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,9 +18,6 @@ jobs: - name: Install deps and build (with cache) uses: bahmutov/npm-install@v1 - - name: Lint - run: yarn lint - - name: Test run: yarn test --ci --coverage --maxWorkers=2 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1299ede --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +name: NPM Publish + +on: + release: + types: [created] + +jobs: + build: + name: Build and publish to NPM + + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v2 + + - name: Use Node 12 + uses: actions/setup-node@v1 + with: + node-version: "12.x" + registry-url: "https://registry.npmjs.org" + + - name: Install deps + run: yarn install + + - name: Test + run: yarn test --ci --coverage --maxWorkers=2 + + - name: Build + run: yarn build + + - name: Publish + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}