Skip to content

Commit d41e749

Browse files
authored
ci: only publish amazonq as "latest" release #7408
Problem: The `browser_download_url` in https://api.github.com/repos/aws/aws-toolkit-vscode/releases/latest points to a random artifact depending on whether toolkit or amazonq was the last release to publish. Solution: Modify the deploy logic to only set "latest" for "amazonq", never "toolkit".
1 parent 9b13c5f commit d41e749

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

buildspec/release/50githubrelease.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,13 @@ phases:
3636
- echo "posting $VERSION with sha384 hash $HASH to GitHub"
3737
- PKG_DISPLAY_NAME=$(grep -m 1 displayName packages/${TARGET_EXTENSION}/package.json | grep -o '[a-zA-z][^\"]\+' | tail -n1)
3838
- RELEASE_MESSAGE="${PKG_DISPLAY_NAME} for VS Code $VERSION"
39+
# Only set amazonq as "latest" release. This ensures https://api.github.com/repos/aws/aws-toolkit-vscode/releases/latest
40+
# consistently points to the amazonq artifact, instead of being "random".
41+
- LATEST="$([ "$TARGET_EXTENSION" = amazonq ] && echo '--latest' || echo '--latest=false' )"
3942
- |
4043
if [ "$STAGE" = "prod" ]; then
4144
# note: the tag arg passed here should match what is in 10changeversion.yml
42-
gh release create --repo $REPO --title "$PKG_DISPLAY_NAME $VERSION" --notes "$RELEASE_MESSAGE" -- "${TARGET_EXTENSION}/v${VERSION}" "$UPLOAD_TARGET" "$HASH_UPLOAD_TARGET"
45+
gh release create "$LATEST" --repo $REPO --title "$PKG_DISPLAY_NAME $VERSION" --notes "$RELEASE_MESSAGE" -- "${TARGET_EXTENSION}/v${VERSION}" "$UPLOAD_TARGET" "$HASH_UPLOAD_TARGET"
4346
else
4447
echo "SKIPPED (stage=${STAGE}): 'gh release create --repo $REPO'"
4548
fi

0 commit comments

Comments
 (0)