feat: adopt trusted publishers #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: publish | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| # push: | |
| # tags: | |
| # - 'v[0-9]+.[0-9]+.[0-9]+' | |
| # - 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+' | |
| # - 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+.[0-9]+' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| registry-url: "https://registry.npmjs.org" | |
| node-version: 22.x | |
| cache: "pnpm" | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build-for-publish | |
| - name: Publish to npm | |
| working-directory: ./dist/ng-qrcode | |
| run: | | |
| pnpm publish --dry-run | |
| # - name: Publish documentation | |
| # run: | | |
| # git config user.name "github-actions[bot]" | |
| # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| # git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY | |
| # pnpm run publish:gh-pages |