name: Build and Publish on: [push, pull_request] jobs: build_and_publish: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: ๐Ÿ›Ž๏ธ Checkout uses: actions/checkout@v2 - name: ๐Ÿ› ๏ธ Configure Registry uses: actions/setup-node@v2 with: node-version: '16.x' registry-url: 'https://npm.pkg.github.com' scope: '@unlock-music' - name: ๐Ÿ“ฆ Install Dependencies run: npm ci - name: ๐Ÿงพ Test run: npm test - name: ๐Ÿ”ฅ Build Package run: npm pack - name: ๐Ÿ’พ Archive Package built uses: actions/upload-artifact@v2 with: name: package path: '*.tgz' - name: ๐Ÿš€ Publish Package run: npm publish if: startsWith(github.ref, 'refs/tags/v') env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}