name: Node.js Package on: release: types: [created] jobs: build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Node uses: actions/setup-node@v3 with: node-version: '18.x' - name: Install run: npm ci - name: Tests & Coverage run: | npm run test npm run coverage - name: Lint run: npm run lint - name: Production Build run: npm run build:prod publish-npm: needs: build runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Node uses: actions/setup-node@v3 with: node-version: '18.x' registry-url: https://registry.npmjs.org/ - name: Read package.json version id: package-version uses: jaywcjlove/github-action-package@main - name: Install run: npm ci - name: Publish Release if: ${{ contains(steps.package-version.outputs.version, '-') == false }} run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish Beta if: ${{ contains(steps.package-version.outputs.version, 'beta') }} run: npm publish --tag beta env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}