From 41e8dc0a3388a25531c7c1cbf8f09e999213ffaf Mon Sep 17 00:00:00 2001 From: Ardalan Amini Date: Sat, 29 Oct 2022 23:17:55 +0330 Subject: [PATCH] ci: Fix release workflow --- .github/workflows/release.yml | 46 ++++++++++++++++------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c593dae..c3c3a1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,18 +45,22 @@ jobs: ${{ steps.changelog.outputs.changelog }} prerelease: ${{ steps.changelog.outputs.prerelease }} - publish-npm: - name: Publish to NPM + publish-gpr: + name: Publish to GitHub Packages needs: - release + permissions: + contents: read + packages: write + environment: - name: npm - url: https://www.npmjs.com/package/@foxify/config + name: gpr + url: https://github.com/${{ github.repository }}/pkgs/npm/config concurrency: - group: ${{ github.workflow }}-npm-${{ github.ref_name }} + group: ${{ github.workflow }}-gpr-${{ github.ref_name }} cancel-in-progress: true runs-on: ubuntu-latest @@ -74,34 +78,31 @@ jobs: with: cache: pnpm node-version: ${{ env.NODE_VERSION }} - registry-url: https://registry.npmjs.org/ + registry-url: https://npm.pkg.github.com/ + scope: '@foxifyjs' + + - run: sed -i 's/@foxify\/config/@foxifyjs\/config/g' package.json - name: Install dependencies run: pnpm i - - run: pnpm build:hybrid - - name: Publish the package run: pnpm publish --tag ${{ needs.release.outputs.release-id }} env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ github.token }} - publish-gpr: - name: Publish to GitHub Packages + publish-npm: + name: Publish to NPM needs: - release - permissions: - contents: read - packages: write - environment: - name: gpr - url: https://github.com/${{ github.repository }}/pkgs/npm/config + name: npm + url: https://www.npmjs.com/package/@foxify/config concurrency: - group: ${{ github.workflow }}-gpr-${{ github.ref_name }} + group: ${{ github.workflow }}-npm-${{ github.ref_name }} cancel-in-progress: true runs-on: ubuntu-latest @@ -119,17 +120,12 @@ jobs: with: cache: pnpm node-version: ${{ env.NODE_VERSION }} - registry-url: https://npm.pkg.github.com/ - scope: '@foxifyjs' - - - run: sed -i 's/@foxify\/config/@foxifyjs\/config/g' package.json + registry-url: https://registry.npmjs.org/ - name: Install dependencies run: pnpm i - - run: pnpm build:hybrid - - name: Publish the package run: pnpm publish --tag ${{ needs.release.outputs.release-id }} env: - NODE_AUTH_TOKEN: ${{ github.token }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}