diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a0965f1..50160f9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,6 +8,7 @@ on: permissions: contents: write pull-requests: write + packages: write id-token: write jobs: @@ -36,8 +37,8 @@ jobs: run: pnpm run ci release-please-action: + needs: [test] runs-on: ubuntu-latest - needs: ["test"] steps: - uses: google-github-actions/release-please-action@main id: release-action @@ -47,16 +48,25 @@ jobs: is-release-created: ${{ steps.release-action.outputs.release_created }} release: + needs: [release-please-action] + if: ${{ needs.release-please-action.outputs.is-release-created == 'true' }} runs-on: ubuntu-latest - needs: ["release-please-action"] - if: ${{ needs.release-please-action.outputs.is-release-created }} + strategy: + matrix: + include: + - name: NPM + registry: https://registry.npmjs.org/ + token-name: NPM_TOKEN + - name: GitHub Packages + registry: https://npm.pkg.github.com/ + token-name: GITHUB_TOKEN steps: - uses: actions/checkout@main - uses: actions/setup-node@main with: - node-version: "20.x" - registry-url: "https://registry.npmjs.org" + node-version: '20.x' + registry-url: ${{ matrix.registry }} - name: Install pnpm uses: pnpm/action-setup@master @@ -69,7 +79,8 @@ jobs: - name: Build package run: pnpm run build - - name: Publish to npm - run: pnpm publish --no-git-checks --provenance --access public + - name: Publish to ${{ matrix.name }} + run: pnpm publish --access public env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets[matrix.token-name] }} + NPM_CONFIG_PROVENANCE: true diff --git a/package.json b/package.json index ab57758..b9b9c50 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "pmjs", + "name": "pubun", "version": "1.0.1", "description": "Asynchronous library with built-in caching to identify available package managers", "exports": {