From 4a2a55ef9160cb429f8cab04016138dc114ffba2 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Fri, 31 Jan 2020 08:34:14 -0500 Subject: [PATCH] publish to NPM via action --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ .github/workflows/test.yml | 8 +++++--- 2 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8a5ee03 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,21 @@ +name: Publish to NPM + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: node cli.js env + - run: npm test + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index df58f75..083fac7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,8 +1,9 @@ -name: Test +name: Run tests + on: [push, pull_request] jobs: - run: + test: name: Node ${{ matrix.node }} runs-on: ubuntu-latest strategy: @@ -14,5 +15,6 @@ jobs: - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node }} - - run: npm install + - run: npm ci + - run: node cli.js env - run: npm test