Publish Package (Patch) #13
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 Package (Patch) | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| registry-url: https://registry.npmjs.org | |
| - uses: pnpm/action-setup@v2 | |
| name: Install pnpm | |
| with: | |
| version: 8 | |
| run_install: false | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Build | |
| run: PATCH=true pnpm build | |
| - name: Publish | |
| run: | | |
| git config --global user.name 'Mike Chabot' | |
| git config --global user.email 'mikechabot@users.noreply.github.com' | |
| npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" | |
| pnpm version patch | |
| pnpm pack | |
| pnpm publish --no-git-checks --access public | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| # See https://github.com/ad-m/github-push-action | |
| - name: Push changes | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: ${{ github.ref }} |