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