diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 125ab9f..26d5c96 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,10 +1,13 @@ -name: Publish package to GitHub Packages +name: Release on: - release: - types: [created] + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + concurrency: group: ${{ github.workflow }} cancel-in-progress: true + jobs: publish: environment: Release @@ -14,6 +17,7 @@ jobs: packages: write steps: - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: ~/.npm @@ -22,17 +26,23 @@ jobs: ${{ runner.os }}-build-node- ${{ runner.os }}-build- ${{ runner.os }}- + - uses: actions/setup-node@v3 with: node-version: 16.x registry-url: https://registry.npmjs.org + - run: npm i + - run: npm run build # Clean up + - run: rm -r node_modules + - run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - uses: ncipollo/release-action@v1 with: generateReleaseNotes: true