diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8947fb..1c6dc30 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,25 +1,34 @@ -name: Publish new release on NPM +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Publish new realese on NPM on: release: types: [created] jobs: - publish: + build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Node.js - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - node-version: '14' + node-version: 16 + - run: npm i + - run: npm run build - - name: Build and Publish - run: | - npm install - npm run build - npm publish --access public + 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 i + - run: npm run build + - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NODE_TOKEN }}