Skip to content

Commit 0bb8523

Browse files
committed
build: update npm publish action
1 parent a1b7d87 commit 0bb8523

File tree

3 files changed

+174
-11
lines changed

3 files changed

+174
-11
lines changed

.github/workflows/release-package.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,30 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
- uses: actions/setup-node@v4
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- uses: pnpm/action-setup@v3
15+
name: Install pnpm
16+
with:
17+
version: 8
18+
run_install: false
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v4
1322
with:
14-
node-version: '20.x'
15-
registry-url: 'https://registry.npmjs.org'
16-
- run: pnpm publish
23+
cache: pnpm
24+
registry-url: https://registry.npmjs.org
25+
26+
- name: Install dependencies
27+
run: pnpm install --frozen-lockfile
28+
29+
- name: Build
30+
run: pnpm build
31+
32+
- name: Publish 🚀
33+
shell: bash
34+
# Must have --no-git-checks enabled due to pnpm not supporting publish from git tags. https://github.com/pnpm/pnpm/issues/5894
35+
run: pnpm publish --no-git-checks
1736
env:
1837
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
".": "./dist/index.js"
99
},
1010
"scripts": {
11-
"build": "tsc && npm run copy-files",
11+
"build": "tsc && pnpm run copy-files",
1212
"clean": "rm -r dist/",
1313
"copy-files": "copyfiles -u 1 src/**/*.otf dist/",
1414
"dev": "ts-node-dev --respawn --transpile-only --poll src/index.ts",
1515
"format": "prettier --write \"src/**\"",
1616
"lint": "eslint \"src/**\"",
17-
"lint:fix": "npm run lint --fix"
17+
"lint:fix": "pnpm run lint --fix"
1818
},
1919
"homepage": "https://github.com/Jejebecarte/minecraft-text-canvas#readme",
2020
"repository": {
@@ -33,6 +33,7 @@
3333
"typescript": "^4.5.5"
3434
},
3535
"dependencies": {
36-
"canvas": "^2.9.3"
36+
"canvas": "^2.9.3",
37+
"copyfiles": "^2.4.1"
3738
}
3839
}

pnpm-lock.yaml

Lines changed: 146 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)