Skip to content

Commit

Permalink
Refactor npm package installation and publishing
Browse files Browse the repository at this point in the history
- Removed the installation of pnpm globally
- Replaced "pnpm install" with "npm install" for build checking
- Removed the setup of pnpm in the second job
- Replaced "pnpm add can-npm-publish --save-dev" with "npm install can-npm-publish --save-dev"
- Updated the publish command to use npm instead of pnpm
  • Loading branch information
zanhk committed Sep 17, 2023
1 parent 0cfb8f5 commit 37a2d74
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: "Install pnpm"
run: npm install -g pnpm
- name: "Check build"
run: pnpm install
run: npm install

bump-version:
needs: build
Expand Down Expand Up @@ -65,19 +63,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: "Install pnpm"
run: |
npm install -g pnpm
pnpm setup
env:
SHELL: bash
- name: "Install can-npm-publish"
run: |
pnpm add can-npm-publish --save-dev
npm install can-npm-publish --save-dev
- name: Setup .temp-npmrc file to authenticate with npm
run: |
echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" > .temp-npmrc
- name: "Git status check"
run: git status
- name: "Publish package if needed"
run: npx can-npm-publish --verbose && pnpm publish --no-git-checks --userconfig .temp-npmrc || echo "Does not publish"
run: npx can-npm-publish --verbose && npm publish --no-git-checks --userconfig .temp-npmrc || echo "Does not publish"

0 comments on commit 37a2d74

Please sign in to comment.