Skip to content

Commit 3255576

Browse files
authored
fix: release buildspec .ymls need to be updated for monorepo change (#4412)
Problem: Release pipeline not behaving as expected, not updating the proper package.json version. Solution: Update for new paths/npm workspaces. ### Testing: Tested some of the commands locally, they seem to be working fine for updating the version, committing now. <!--- REMINDER: - Read CONTRIBUTING.md first. - Add test coverage for your changes. - Update the changelog using `npm run newChange`. - Link to related issues/commits. - Testing: how did you test your changes? - Screenshots --> ## License By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. Co-authored-by: aws-toolkit-automation <>
1 parent bd2d61e commit 3255576

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ jobs:
5353
run: |
5454
npm run createRelease # Generate CHANGELOG.md
5555
cp ./README.quickstart.vscode.md ./README.md
56-
cd packages/toolkit
57-
npm run package -- --feature "$FEAT_NAME"
56+
npm run -w packages/toolkit package -- --feature "$FEAT_NAME"
5857
- uses: actions/upload-artifact@v4
5958
with:
6059
name: artifacts
@@ -65,7 +64,7 @@ jobs:
6564
run: |
6665
echo "feature=$FEAT_NAME" >> $GITHUB_OUTPUT
6766
echo "tagname=$TAG_NAME" >> $GITHUB_OUTPUT
68-
echo "version=$(grep -m 1 version package.json | grep -o '[0-9][^\"]\+' | sed 's/-SNAPSHOT//')" >> $GITHUB_OUTPUT
67+
echo "version=$(grep -m 1 version packages/toolkit/package.json | grep -o '[0-9][^\"]\+' | sed 's/-SNAPSHOT//')" >> $GITHUB_OUTPUT
6968
echo 'changes<<EOF' >> $GITHUB_OUTPUT
7069
cat CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print; exit if $. == 2' >> $GITHUB_OUTPUT
7170
echo 'EOF' >> $GITHUB_OUTPUT

buildspec/release/10changeversion.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ phases:
1515
echo "Removing SNAPSHOT from version string"
1616
git config --global user.name "aws-toolkit-automation"
1717
git config --global user.email "<>"
18-
VERSION=$(node -e "console.log(require('./package.json').version);" | (IFS="-"; read -r version unused && echo "$version"))
18+
VERSION=$(node -e "console.log(require('./packages/toolkit/package.json').version);" | (IFS="-"; read -r version unused && echo "$version"))
1919
DATE=$(date)
20-
npm version --no-git-tag-version "$VERSION"
20+
npm version --no-git-tag-version "$VERSION" -w packages/toolkit
2121
# Call npm ci because 'createRelease' uses ts-node
2222
npm ci
2323
- |
2424
npm run createRelease
2525
- |
26-
git add package.json
26+
git add packages/toolkit/package.json
2727
git add package-lock.json
2828
git commit -m "Release $VERSION"
2929
echo "tagging commit"

buildspec/release/20buildrelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ phases:
2727
artifacts:
2828
files:
2929
- aws-toolkit-vscode*
30-
- package.json
30+
- packages/toolkit/package.json
3131
discard-paths: true

buildspec/release/40pushtogithub.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ phases:
2424
git remote add originWithCreds "$REPO_URL"
2525
echo "Adding SNAPSHOT to next version string"
2626
# Increase minor version
27-
npm version --no-git-tag-version minor
28-
VERSION=$(node -e "console.log(require('./package.json').version);")
27+
npm version --no-git-tag-version minor -w packages/toolkit
28+
VERSION=$(node -e "console.log(require('./packages/toolkit/package.json').version);")
2929
# Append -SNAPSHOT
30-
npm version --no-git-tag-version "${VERSION}-SNAPSHOT"
31-
git add package.json
30+
npm version --no-git-tag-version "${VERSION}-SNAPSHOT" -w packages/toolkit
31+
git add packages/toolkit/package.json
3232
git add package-lock.json
3333
git commit -m "Update version to snapshot version: ${VERSION}-SNAPSHOT"
3434
- |

buildspec/release/50githubrelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ phases:
2525
commands:
2626
# pull in the build artifacts
2727
- cp -r ${CODEBUILD_SRC_DIR_buildPipeline}/* .
28-
- VERSION=$(node -e "console.log(require('./package.json').version);")
28+
- VERSION=$(node -e "console.log(require('./packages/toolkit/package.json').version);")
2929
- UPLOAD_TARGET=$(ls aws-toolkit-vscode*.vsix)
3030
- HASH_UPLOAD_TARGET=${UPLOAD_TARGET}.sha384
3131
- 'HASH=$(sha384sum -b $UPLOAD_TARGET | cut -d" " -f1)'

0 commit comments

Comments
 (0)