11name : build
22on : [push]
3+
4+ permissions :
5+ contents : write # Create releases and tags
6+ pull-requests : write # Comment on PRs with release info
7+ packages : write # Publish to GitHub Packages
8+
39jobs :
410 build-linting :
511 uses : ./.github/workflows/linting.yml
@@ -16,28 +22,14 @@ jobs:
1622 persist-credentials : false # https://stackoverflow.com/questions/74744498/github-pushing-to-protected-branches-with-fine-grained-token
1723
1824 - name : Setup node
19- uses : actions/setup-node@v2
20- env :
21- NPM_TOKEN : ' ' # https://github.com/JS-DevTools/npm-publish/issues/15
25+ uses : actions/setup-node@v6
2226 with :
23- cache-dependency-path : package.json # we don't have a package-lock.json so we'll use this instead...
24- node-version : ' 18'
25-
26- - name : Run `npm install --no-package-lock --no-fund` on cli-output-helpers
27- run : npm install --no-package-lock --no-fund
28- working-directory : tools/cli-output-helpers
27+ node-version : ' 21'
2928
30- - name : Build cli-output-helpers
31- run : npm run build
32- working-directory : tools/cli-output-helpers
33-
34- - name : Run `npm install --no-package-lock --no-fund` on nevermore-template-helpers
35- run : npm install --no-package-lock --no-fund
36- working-directory : tools/nevermore-template-helpers
37-
38- - name : Build nevermore-template-helpers
39- run : npm run build
40- working-directory : tools/nevermore-template-helpers
29+ - name : Setup pnpm
30+ uses : pnpm/action-setup@v4
31+ with :
32+ cache : true
4133
4234 - name : Setup npm for GitHub Packages
4335 run : |
@@ -49,23 +41,18 @@ jobs:
4941 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5042 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
5143
52- - name : Run `npm install --no-package-lock` on nevermore-cli
53- run : npm install --no-package-lock
54- working-directory : tools/nevermore-cli
55-
56- - name : Build nevermore-cli
57- run : npm run build
58- working-directory : tools/nevermore-cli
44+ - name : Install dependencies
45+ run : pnpm install --frozen-lockfile
5946
60- - name : Run npm install
61- run : npm install --no-save --no-fund
47+ - name : Build all tools
48+ run : pnpm -r --filter './tools/**' run build
6249
6350 - name : Git reset .npmrc
6451 run : git checkout .npmrc
6552
6653 - name : Create Release
6754 env :
68- GITHUB_TOKEN : ${{ secrets.NEVERMORE_CI_PAT }}
55+ GITHUB_TOKEN : ${{ github.ref == 'refs/heads/main' && secrets.NEVERMORE_CI_PAT || secrets.GITHUB_TOKEN }}
6956 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
7057 run : npx auto shipit
7158
0 commit comments