From cc8a947ca800ceaff99a0f8426bf9c223fd69bb7 Mon Sep 17 00:00:00 2001 From: Ismail Uddin Date: Wed, 23 Apr 2025 21:54:34 +0100 Subject: [PATCH] ci: fix bugs with package publishing --- .github/workflows/release.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e027ed..bb52909 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,9 +15,10 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: "22" + registry-url: 'https://registry.npmjs.org' - name: Install pnpm run: npm install -g pnpm@latest - name: Install dependencies @@ -38,19 +39,21 @@ jobs: - name: Bump pre-release version run: pnpm run release --prerelease beta if: ${{ github.event.inputs.pre_release == 'true' }} - - name: Commit and push schemas - run: | - git push origin dev --tags - name: Publish - run: npm publish + run: npm publish --provenance --access public if: ${{ github.event.inputs.pre_release == 'false' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Publish pre-release - run: npm publish --tag next + run: npm publish --provenance --access public --tag next if: ${{ github.event.inputs.pre_release == 'true' }} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Merge source branch into main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + git push origin dev --tags git fetch origin git checkout main git merge dev