Skip to content

Commit 5fc9377

Browse files
ci(release): npm install in bump-version.sh
Needed so that the `package-lock.json` remains in sync with the `package.json` after bumping version numbers.
1 parent 0a89b3d commit 5fc9377

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

.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: 17 additions & 1 deletion
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,17 @@ jobs:
1924
with:
2025
node-version-file: package.json
2126

27+
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
28+
# We have to use npm here because yarn fails on the non-existing existing optionalDependency version:
29+
# https://github.com/yarnpkg/berry/issues/2425#issuecomment-1627807326
30+
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install --omit=optional --ignore-scripts
31+
if: ${{ inputs.triggered-by-release }}
32+
2233
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
2334
# We have to use npm here because yarn fails on the non-existing existing optionalDependency version:
2435
# https://github.com/yarnpkg/berry/issues/2425#issuecomment-1627807326
2536
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm ci
37+
if: ${{ !inputs.triggered-by-release }}
2638

2739
- run: npm run check:types
2840

@@ -46,7 +58,11 @@ jobs:
4658
# We need to skip the fallback download because downloading will fail on release branches because the new version isn't available yet.
4759
# We have to use npm here because yarn fails on the non-existing existing optionalDependency version:
4860
# https://github.com/yarnpkg/berry/issues/2425#issuecomment-1627807326
49-
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm ci
61+
- run: SENTRYCLI_SKIP_DOWNLOAD=1 npm install --omit=optional --ignore-scripts
62+
if: ${{ inputs.triggered-by-release }}
63+
64+
- run: npm ci
65+
if: ${{ !inputs.triggered-by-release }}
5066

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

scripts/bump-version.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ done
3535
# Update the optional deps in the main cli npm package
3636
# Requires jq to be installed - should be installed ootb on github runners
3737
jq '.optionalDependencies |= map_values("'"${TARGET}"'")' $SCRIPT_DIR/../package.json > package.json.tmp && mv package.json.tmp $SCRIPT_DIR/../package.json
38+
39+
# Update the dependencies in the package-lock.json, too, skipping the download
40+
# because the new version is not published yet.
41+
SENTRYCLI_SKIP_DOWNLOAD=1 npm install --omit=optional --package-lock-only --ignore-scripts

0 commit comments

Comments
 (0)