diff --git a/.github/workflows/ci-main.yaml b/.github/workflows/ci-main.yaml index ff11e8d..e37711f 100644 --- a/.github/workflows/ci-main.yaml +++ b/.github/workflows/ci-main.yaml @@ -19,12 +19,18 @@ jobs: uses: oven-sh/setup-bun@v2 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Run CI run: bun run ci - - name: Publish to NPM package registry - run: npm publish --access=public --tag=latest + - name: Prepare .npmrc for publishing + run: | + echo "@secretkeylabs:registry=https://registry.npmjs.org/" > .npmrc + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }} + + - name: Publish to NPM package registry + # https://github.com/oven-sh/bun/issues/1976 + run: bunx npm@latest publish --access=public --tag=latest diff --git a/.github/workflows/ci-pr.yaml b/.github/workflows/ci-pr.yaml index 7572085..fb7ae3a 100644 --- a/.github/workflows/ci-pr.yaml +++ b/.github/workflows/ci-pr.yaml @@ -18,7 +18,7 @@ jobs: uses: oven-sh/setup-bun@v2 - name: Install dependencies - run: bun install + run: bun install --frozen-lockfile - name: Run CI run: bun run ci @@ -38,9 +38,15 @@ jobs: SHA: ${{ steps.sha.outputs.SHA }} CURRENT_VERSION: ${{ steps.current-version.outputs.CURRENT_VERSION }} + - name: Prepare .npmrc for publishing + run: | + echo "@secretkeylabs:registry=https://registry.npmjs.org/" > .npmrc + echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc + env: + NPM_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }} + - name: Publish to NPM package registry # https://github.com/oven-sh/bun/issues/1976 run: bunx npm@latest publish --access=public --tag pr-$PR_NUMBER env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_PACKAGE_REGISTRY_TOKEN }} PR_NUMBER: ${{ github.event.number }}