Skip to content

Commit

Permalink
added workflow for publishing npm package using pnpm
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Westover <scottwestover2006@gmail.com>
  • Loading branch information
scottwestover committed Dec 28, 2023
1 parent e96429a commit a3235bf
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/pnpm-publish-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish NPM Package

on:
workflow_call:
secrets:
npm_token:
required: true
gh_token:
required: true

jobs:
npm-publish:
runs-on: ubuntu-latest

strategy:
fail-fast: true

steps:
- uses: actions/checkout@v3

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: "18.x"

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8

- name: install project dependencies
run: pnpm install --frozen-lockfile

- name: build project
run: pnpm build

- run: git config user.email "scottwestover2006@gmail.com"
- run: git config user.name "@github-ci"
- run: pnpm version --patch --message "Bump version to %s"

- run: git push
- run: git push --follow-tags

- name: publish to npm
run: |
npm set //registry.npmjs.org/:_authToken ${{ secrets.npm_token }}
pnpm publish:npm
- name: publish to github
run: |
npm config set registry https://npm.pkg.github.com
npm set //npm.pkg.github.com/:_authToken ${{ secrets.gh_token }}
pnpm publish:github

0 comments on commit a3235bf

Please sign in to comment.