-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added workflow for publishing npm package using pnpm
Signed-off-by: Scott Westover <scottwestover2006@gmail.com>
- Loading branch information
1 parent
e96429a
commit a3235bf
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |