Skip to content

Commit 1aefb76

Browse files
ci(release): npm install in test_node.yml on release
`npm ci` will fail here, as the new versions of the optional dependencies are not published yet.
1 parent 0a89b3d commit 1aefb76

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
test_node:
2929
name: Test Node
3030
uses: ./.github/workflows/test_node.yml
31+
with:
32+
triggered-by-release: ${{ github.event_name == 'push' && startsWith(github.ref_name, 'release/') }}
3133

3234
test_swift:
3335
name: Test Swift

.github/workflows/test_node.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Test Node
22

33
on:
44
workflow_call:
5+
inputs:
6+
triggered-by-release:
7+
type: boolean
8+
description: Whether the workflow was triggered by a release
9+
default: false
510
outputs:
611
matrix-result:
712
description: 'Matrix job result'
@@ -19,10 +24,13 @@ jobs:
1924
with:
2025
node-version-file: package.json
2126

22-
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
23-
# We have to use npm here because yarn fails on the non-existing existing optionalDependency version:
24-
# https://github.com/yarnpkg/berry/issues/2425#issuecomment-1627807326
25-
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm ci
27+
- name: Install dependencies via npm ci
28+
if: ${{ !inputs.triggered-by-release }}
29+
run: npm ci
30+
31+
- name: Install dependencies via npm install (for pushes to release branch)
32+
if: ${{ inputs.triggered-by-release }}
33+
run: npm install --omit=optional --ignore-scripts
2634

2735
- run: npm run check:types
2836

@@ -43,10 +51,13 @@ jobs:
4351
with:
4452
node-version: ${{ matrix.node-version }}
4553

46-
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
47-
# We have to use npm here because yarn fails on the non-existing existing optionalDependency version:
48-
# https://github.com/yarnpkg/berry/issues/2425#issuecomment-1627807326
49-
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm ci
54+
- name: Install dependencies via npm ci
55+
if: ${{ !inputs.triggered-by-release }}
56+
run: npm ci
57+
58+
- name: Install dependencies via npm install (for pushes to release branch)
59+
if: ${{ inputs.triggered-by-release }}
60+
run: npm install --omit=optional --ignore-scripts
5061

5162
# older node versions need an older nft
5263
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install @vercel/nft@0.22.1

0 commit comments

Comments
 (0)