Skip to content

Commit eae60a6

Browse files
authored
Automate updating pu/pu node dependency (#1320)
Adds automation for updating the pu/pu node dependency. This also adds tools for deduplicating entries in the yarn.lock file. Those sometimes happen when upgrading dependencies... :( yarnpkg/yarn#3967
1 parent 847dcee commit eae60a6

File tree

3 files changed

+52
-10
lines changed

3 files changed

+52
-10
lines changed

.github/workflows/weekly-pulumi-update.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ jobs:
2424
uses: actions/setup-go@v4
2525
with:
2626
go-version: ${{ env.GOVERSION }}
27+
- name: Install Yarn
28+
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
29+
- name: Update PATH for Yarn
30+
run: |
31+
echo "$HOME/.yarn/bin" >> $GITHUB_PATH
32+
echo "$HOME/.config/yarn/global/node_modules/.bin" >> $GITHUB_PATH
2733
- name: Update Pulumi/Pulumi
2834
id: gomod
2935
run: |
@@ -39,6 +45,17 @@ jobs:
3945
echo "Updating Pulumi dependencies to $PULUMI_VERSION"
4046
./scripts/bump-pulumi-deps.sh --version "$PULUMI_VERSION"
4147
48+
echo "Updating node @pulumi/pulumi to $PULUMI_VERSION"
49+
pushd awsx
50+
# Strips the v from the version to get the correct npm version
51+
yarn upgrade @pulumi/pulumi@${PULUMI_VERSION#v}
52+
yarn run dedupe-deps
53+
54+
echo "Ensure that we don't have any duplicate dependencies"
55+
yarn run check-duplicate-deps
56+
popd
57+
58+
4259
git update-index -q --refresh
4360
4461
if ! git diff-files --quiet; then
@@ -55,14 +72,6 @@ jobs:
5572
with:
5673
node-version: ${{env.NODEVERSION}}
5774
registry-url: https://registry.npmjs.org
58-
- name: Install Yarn
59-
if: steps.gomod.outputs.changes != 0
60-
run: curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
61-
- name: Update PATH for Yarn
62-
if: steps.gomod.outputs.changes != 0
63-
run: |
64-
echo "$HOME/.yarn/bin" >> $GITHUB_PATH
65-
echo "$HOME/.config/yarn/global/node_modules/.bin" >> $GITHUB_PATH
6675
- name: Install pulumictl
6776
if: steps.gomod.outputs.changes != 0
6877
uses: jaxxstorm/[email protected]

awsx/package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
"lint": "tslint -c tslint.json -p tsconfig.json",
1919
"test": "jest",
2020
"tsc": "tsc --incremental",
21-
"start": "ts-node index.ts"
21+
"start": "ts-node index.ts",
22+
"dedupe-deps": "yarn-deduplicate",
23+
"check-duplicate-deps": "yarn-deduplicate --fail"
2224
},
2325
"//": "Pulumi sub-provider dependencies must be pinned at an exact version because we extract this value to generate the correct dependency in the schema",
2426
"dependencies": {
@@ -51,7 +53,8 @@
5153
"ts-node": "^10.7.0",
5254
"tslint": "^6.1.3",
5355
"typedoc": "^0.13.0",
54-
"typescript": "^4.6.2"
56+
"typescript": "^4.6.2",
57+
"yarn-deduplicate": "^6.0.2"
5558
},
5659
"jest": {
5760
"modulePathIgnorePatterns": [

awsx/yarn.lock

+30
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,11 @@
18061806
dependencies:
18071807
"@types/yargs-parser" "*"
18081808

1809+
"@yarnpkg/lockfile@^1.1.0":
1810+
version "1.1.0"
1811+
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
1812+
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==
1813+
18091814
acorn-walk@^8.1.1:
18101815
version "8.2.0"
18111816
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1"
@@ -2257,6 +2262,11 @@ color-name@~1.1.4:
22572262
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
22582263
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
22592264

2265+
commander@^10.0.1:
2266+
version "10.0.1"
2267+
resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06"
2268+
integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==
2269+
22602270
commander@^2.12.1, commander@^2.20.0:
22612271
version "2.20.3"
22622272
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
@@ -4601,6 +4611,11 @@ semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.5.2, semver@^7.5.3, semve
46014611
dependencies:
46024612
lru-cache "^6.0.0"
46034613

4614+
semver@^7.5.0:
4615+
version "7.6.2"
4616+
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
4617+
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==
4618+
46044619
set-function-name@^2.0.0:
46054620
version "2.0.0"
46064621
resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.0.tgz#e59e53e7fa23f9c2da1c0999fa202d5ed09c4756"
@@ -4967,6 +4982,11 @@ tslib@^1.13.0, tslib@^1.8.1:
49674982
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
49684983
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
49694984

4985+
tslib@^2.5.0:
4986+
version "2.6.3"
4987+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
4988+
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
4989+
49704990
tslint@^6.1.3:
49714991
version "6.1.3"
49724992
resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.3.tgz#5c23b2eccc32487d5523bd3a470e9aa31789d904"
@@ -5361,6 +5381,16 @@ yargs@^17.3.1, yargs@^17.7.2:
53615381
y18n "^5.0.5"
53625382
yargs-parser "^21.1.1"
53635383

5384+
yarn-deduplicate@^6.0.2:
5385+
version "6.0.2"
5386+
resolved "https://registry.yarnpkg.com/yarn-deduplicate/-/yarn-deduplicate-6.0.2.tgz#63498d2d4c3a8567e992a994ce0ab51aa5681f2e"
5387+
integrity sha512-Efx4XEj82BgbRJe5gvQbZmEO7pU5DgHgxohYZp98/+GwPqdU90RXtzvHirb7hGlde0sQqk5G3J3Woyjai8hVqA==
5388+
dependencies:
5389+
"@yarnpkg/lockfile" "^1.1.0"
5390+
commander "^10.0.1"
5391+
semver "^7.5.0"
5392+
tslib "^2.5.0"
5393+
53645394
53655395
version "3.1.1"
53665396
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"

0 commit comments

Comments
 (0)