Publish packages to NPM #15
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 packages to NPM | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Version | |
| type: string | |
| required: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| env: | |
| VERSION: ${{github.event.release.tag_name || inputs.version}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| # Setup .npmrc file to publish to npm | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: latest | |
| cache: pnpm | |
| registry-url: 'https://registry.npmjs.org' | |
| scope: '@proicons' | |
| - name: Install dependencies | |
| run: | | |
| pnpm install --frozen-lockfile | |
| - name: Bump version | |
| run: | | |
| node ./bin/bumpVersion.js -v $VERSION | |
| - name: Build packages | |
| run: | | |
| pnpm run ci | |
| pnpm --filter @proicons/svelte run ci | |
| - name: Set auth token | |
| run: pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.PUBLISH_KEY }} | |
| - name: Publish to NPM | |
| run: | | |
| pnpm --filter @proicons/svelte publish --provenance --no-git-checks | |
| env: | |
| NPM_CONFIG_PROVENANCE: true |