Skip to content

Commit dd1eb37

Browse files
committed
ci: Update to pnpm for faster CI/CD and local development workflow
1 parent fcf9959 commit dd1eb37

File tree

17 files changed

+15045
-98
lines changed

17 files changed

+15045
-98
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: build
22
on: [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+
39
jobs:
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

.github/workflows/docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ jobs:
99
name: Build and deploy docs
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v6
13-
- uses: actions/setup-node@v2
12+
- name: Setup node
13+
uses: actions/setup-node@v6
1414
with:
15-
node-version: '18'
15+
node-version: '21'
16+
1617
- run: npm i -g moonwave@latest
1718
- name: Publish
1819
run: |

.github/workflows/linting.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
with:
1313
version: 'v0.3.0'
1414
token: ${{ secrets.GITHUB_TOKEN }}
15+
cache: true
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
cache: true
1521

1622
- name: Setup npm for GitHub Packages
1723
run: |
@@ -23,37 +29,16 @@ jobs:
2329
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2430
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2531

26-
- name: Run `npm install --no-package-lock` on cli-output-helpers
27-
run: npm install --no-package-lock --no-fund
28-
working-directory: tools/cli-output-helpers
29-
30-
- name: Build cli-output-helpers
31-
run: npm run build
32-
working-directory: tools/cli-output-helpers
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
3334

34-
- name: Run `npm install --no-package-lockd` 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
41-
42-
- name: Run `npm install --no-package-lock` on nevermore-cli
43-
run: npm install --no-package-lock --no-fund
44-
working-directory: tools/nevermore-cli
45-
46-
- name: Build nevermore-cli
47-
run: npm run build
48-
working-directory: tools/nevermore-cli
35+
- name: Build all tools
36+
run: pnpm -r --filter './tools/**' --filter '!./tools/nevermore-vscode' run build
4937

5038
- name: Install nevermore-cli locally
5139
run: npm install -g .
5240
working-directory: tools/nevermore-cli
5341

54-
- name: Link and install packages
55-
run: npm run build:link
56-
5742
- name: Generate Sourcemap
5843
run: npm run build:sourcemap
5944

@@ -71,6 +56,7 @@ jobs:
7156
with:
7257
version: 'v0.3.0'
7358
token: ${{ secrets.GITHUB_TOKEN }}
59+
cache: true
7460

7561
- name: stylua check
7662
run: npm run lint:stylua
@@ -86,6 +72,7 @@ jobs:
8672
with:
8773
version: 'v0.3.0'
8874
token: ${{ secrets.GITHUB_TOKEN }}
75+
cache: true
8976

9077
- name: selene check
9178
run: npm run lint:selene
@@ -101,6 +88,7 @@ jobs:
10188
with:
10289
version: 'v0.3.0'
10390
token: ${{ secrets.GITHUB_TOKEN }}
91+
cache: true
10492

10593
- name: Run moonwave-extractor
10694
run: npm run lint:moonwave

.github/workflows/tests.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ jobs:
1010
fetch-depth: 0
1111

1212
- name: Setup node
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v6
1414
with:
15-
cache-dependency-path: package.json
16-
node-version: '18'
15+
node-version: '21'
1716

18-
- name: Install GitHub CLI
19-
run: |
20-
sudo apt update
21-
sudo apt install gh -y
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
cache: true
2221

2322
- name: Setup npm for GitHub Packages
2423
run: |
@@ -30,10 +29,11 @@ jobs:
3029
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3130
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3231

33-
- name: Install package dependencies
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Compute changed packages
3436
run: |
35-
echo "Installing package dependencies..."
36-
npx lerna exec -- npm install --no-audit --no-fund
3737
PACKAGES=$(npx lerna ls --since origin/main --json | jq -r '.[] | select(.name != "@quenty/nevermore-cli") | .location' | tr '\n' ' ')
3838
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
3939
@@ -46,15 +46,16 @@ jobs:
4646
echo "Installing changed packages..."
4747
npm i ${{ env.PACKAGES }}
4848
49-
echo "Installing Jest"
50-
npm i https://github.com/quentystudios/jest-lua.git
49+
echo "Installing Jest..."
50+
pnpm add https://github.com/quentystudios/jest-lua.git
5151
5252
- name: Setup Aftman
5353
uses: ok-nick/setup-aftman@v0.4.2
5454
with:
5555
path: tests/bin
5656
version: 'v0.3.0'
5757
token: ${{ secrets.GITHUB_TOKEN }}
58+
cache: true
5859

5960
- name: Generate test place file
6061
run: rojo build default.project.json -o testBuild.rbxl

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ dist
1212
.DS_Store
1313
globalTypes.d.lua
1414
*.vsix
15+
tests/bin
1516

1617
# Normally it's a good idea to commit this. However, in this mono-repo scenario with linking
17-
# it adds a ton of noise and no real gain. Also we have seen no gains from reproducing
18-
# builds so we don't have a strict need for this right now.
19-
package-lock.json
20-
tests/bin
18+
# it adds a ton of noise and no real gain. Instead, we rely upon pnpm-lock.yaml which is less messy.
19+
package-lock.json

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
package-lock = false

lerna.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"packages": [
3-
"src/*",
4-
"tools/*"
5-
],
2+
"npmClient": "pnpm",
3+
"packages": ["src/*", "tools/*"],
64
"command": {
7-
"publish": {
8-
"verifyAccess": false
9-
},
5+
"publish": {},
106
"version": {
117
"conventionalCommits": true,
128
"createRelease": "github",

package.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
{
22
"name": "@quenty/nevermore",
33
"private": true,
4+
"packageManager": "pnpm@10.27.0",
45
"repository": {
56
"type": "git",
67
"url": "https://github.com/Quenty/NevermoreEngine.git"
78
},
89
"devDependencies": {
9-
"@auto-it/all-contributors": "^v11.0.4",
10-
"@auto-it/conventional-commits": "^v11.0.4",
11-
"@auto-it/first-time-contributor": "^v11.0.4",
12-
"@auto-it/npm": "^v11.0.4",
13-
"@auto-it/released": "^v11.0.4",
14-
"auto": "^v11.0.4",
15-
"lerna": "^7.1.4",
16-
"moonwave": "^1.1.2"
10+
"@auto-it/all-contributors": "^v11.3.6",
11+
"@auto-it/conventional-commits": "^v11.3.6",
12+
"@auto-it/first-time-contributor": "^v11.3.6",
13+
"@auto-it/npm": "^v11.3.6",
14+
"@auto-it/released": "^v11.3.6",
15+
"auto": "^v11.3.6",
16+
"lerna": "^9.0.3",
17+
"moonwave": "^1.3.0",
18+
"pnpm": "^10.27.0"
1719
},
1820
"scripts": {
19-
"build:link": "npx lerna exec --parallel -- npm install --no-package-lock --no-audit --no-fund",
21+
"build:link": "pnpm install",
2022
"build:sourcemap": "rojo sourcemap default.project.json --output sourcemap.json --absolute",
2123
"format": "stylua --config-path=stylua.toml src games tests plugins",
2224
"lint:luau": "luau-lsp analyze --sourcemap=sourcemap.json --base-luaurc=.luaurc --defs=globalTypes.d.lua --flag:LuauSolverV2=false --ignore=**/node_modules/** --ignore=**/*.story.lua --ignore=**/*.client.lua --ignore=**/*.server.lua src",
2325
"lint:moonwave": "npx lerna exec --parallel -- moonwave-extractor extract src",
2426
"lint:selene": "npx lerna exec --parallel -- selene --no-summary --num-threads=1 --config=../../selene.toml src",
2527
"lint:stylua": "stylua --config-path=stylua.toml --check src games tests plugins",
26-
"postinstall": "npm run build:link",
2728
"prelint:luau": "npm run build:sourcemap && npx @quenty/nevermore-cli download-roblox-types",
2829
"prelint:selene": "selene generate-roblox-std",
2930
"release": "auto shipit"

0 commit comments

Comments
 (0)