Skip to content

Commit

Permalink
ci: use .nvmrc for node-setup node-version in github actions (immich-…
Browse files Browse the repository at this point in the history
…app#10619)

* chore: add node version pinning with .nvmrc and volta for the typescript sdk

* ci: add missing setup-node actions and use .nvmrc for setup-node node-version
  • Loading branch information
zackpollard authored Jun 25, 2024
1 parent b5b0c6f commit 5912fcc
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: './cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Prepare SDK
run: npm ci --prefix ../open-api/typescript-sdk/
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: './docs/.nvmrc'

- name: Run npm install
run: npm ci

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '20.x'
node-version-file: './open-api/typescript-sdk/.nvmrc'
registry-url: 'https://registry.npmjs.org'
- name: Install deps
run: npm ci
Expand Down
26 changes: 23 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: './server/.nvmrc'

- name: Run npm install
run: npm ci

Expand Down Expand Up @@ -54,7 +59,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: './cli/.nvmrc'

- name: Setup typescript-sdk
run: npm ci && npm run build
Expand Down Expand Up @@ -93,7 +98,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: './cli/.nvmrc'

- name: Setup typescript-sdk
run: npm ci && npm run build
Expand Down Expand Up @@ -122,6 +127,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: './web/.nvmrc'

- name: Run setup typescript-sdk
run: npm ci && npm run build
working-directory: ./open-api/typescript-sdk
Expand Down Expand Up @@ -165,7 +175,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
node-version-file: './e2e/.nvmrc'

- name: Run setup typescript-sdk
run: npm ci && npm run build
Expand Down Expand Up @@ -273,6 +283,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: './server/.nvmrc'

- name: Install server dependencies
run: npm --prefix=server ci

Expand Down Expand Up @@ -323,6 +338,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: './server/.nvmrc'

- name: Install server dependencies
run: npm ci

Expand Down
1 change: 1 addition & 0 deletions open-api/typescript-sdk/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.15.0
5 changes: 4 additions & 1 deletion open-api/typescript-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@
"@oazapfts/runtime": "^1.0.2"
},
"devDependencies": {
"@types/node": "^20.11.0",
"@types/node": "^20.11",
"typescript": "^5.3.3"
},
"repository": {
"type": "git",
"url": "git+https://github.com/immich-app/immich.git",
"directory": "open-api/typescript-sdk"
},
"volta": {
"node": "20.15.0"
}
}

0 comments on commit 5912fcc

Please sign in to comment.