diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml new file mode 100644 index 0000000..aceeb0c --- /dev/null +++ b/.github/workflows/package.yml @@ -0,0 +1,37 @@ +name: Publish package + +on: + release: + types: + - published + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm run build --if-present + - run: npm test + + publish-npm: + name: Publish to npm + needs: build + 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 install + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}