diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 4278e0509..000000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Publish package to GitHub Packages -on: - push: - tags: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - # Setup .npmrc file to publish to GitHub Packages - - uses: actions/setup-node@v3 - with: - node-version: '14.x' - registry-url: 'https://npm.pkg.github.com' - # Defaults to the user or organization that owns the workflow file - scope: '@adrise' - - run: yarn --frozen-lockfile - - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 74b1afb7c..cf0becd89 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,3 +19,17 @@ jobs: - name: Print release output if: ${{ steps.release.outputs.released == 'true' }} run: echo Release ID ${{ steps.release.outputs.release_id }} + # Setup .npmrc file to publish to GitHub Packages + - uses: actions/setup-node@v3 + if: ${{ steps.release.outputs.released == 'true' }} + with: + node-version: '14.x' + registry-url: 'https://npm.pkg.github.com' + # Defaults to the user or organization that owns the workflow file + scope: '@adrise' + - run: yarn --frozen-lockfile + if: ${{ steps.release.outputs.released == 'true' }} + - run: npm publish + if: ${{ steps.release.outputs.released == 'true' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}