Skip to content

Commit

Permalink
workflow(GitHub Actions): fix the error—cnpm: command not found
Browse files Browse the repository at this point in the history
  • Loading branch information
cloydlau committed Oct 11, 2024
1 parent 0ebda26 commit bbffe8f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 10 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: cnpm sync
if: success()

- run: curl -L https://npmmirror.com/sync/json-editor-vue
if: success()

- run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- run: pnpm sync-to-cnpm
if: success()
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
"test:coverage": "vitest run --coverage",
"test:ui": "vitest --ui",
"doc": "vitepress dev --open /README",
"build": "vite build && pnpm typegen",
"typegen": "npx tsup --entry.json-editor-vue src/index.ts --format esm,cjs --cjsInterop --clean --dts-only",
"check-exports": "pnpm build && npx attw $(npm pack)",
"build": "vite build && pnpm typegen",
"release": "esno ./scripts/release.mts",
"sync-to-cnpm": "npx cnpm sync && curl -L https://npmmirror.com/sync/json-editor-vue",
"license-scan": "license-checker --summary --out ./dependency-licenses.txt",
"lint": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --ignore-pattern stats.html",
"lint:fix": "eslint \"**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx,vue,json,md,html,css,scss,sass}\" --ignore-pattern stats.html --fix",
Expand Down Expand Up @@ -105,6 +105,7 @@
"@vue/test-utils": "latest",
"axios": "^1.7.7",
"case-police": "^0.7.0",
"cnpm": "^9.4.0",
"cross-spawn": "^7.0.3",
"del": "^8.0.0",
"destr": "^2.0.3",
Expand Down
22 changes: 22 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions scripts/release.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ async function release() {
return
}

console.log(cyan('\nChecking exports...'))
if (spawn.sync('pnpm', ['check-exports'], { stdio: 'inherit' }).status === 1) {
console.log(cyan('\nAnalyzing types...'))
if (spawn.sync('npx', ['attw', '$(npm pack)'], { stdio: 'inherit' }).status === 1) {
return
}
// await deleteAsync(['./*.tgz'])
Expand Down

0 comments on commit bbffe8f

Please sign in to comment.