From 55abad4f5353127f944df5a930348e6aaafb3456 Mon Sep 17 00:00:00 2001 From: Maxim Hayes Date: Tue, 18 Feb 2025 11:38:57 -0500 Subject: [PATCH] ci: add post-release notification buildspec Will enable for prod once I confirm it outputs the proper messages. --- buildspec/release/80notify.yml | 28 ++++++++++++++++++++++++++++ buildspec/release/notify.txt | 6 ++++++ 2 files changed, 34 insertions(+) create mode 100644 buildspec/release/80notify.yml create mode 100644 buildspec/release/notify.txt diff --git a/buildspec/release/80notify.yml b/buildspec/release/80notify.yml new file mode 100644 index 00000000000..0dee2b75552 --- /dev/null +++ b/buildspec/release/80notify.yml @@ -0,0 +1,28 @@ +version: 0.2 + +phases: + install: + runtime-versions: + nodejs: 20 + + pre_build: + commands: + # Check for implicit env vars passed from the release pipeline. + - test -n "${NOTIFY_URL}" + - test -n "${TARGET_EXTENSION}" + + build: + commands: + - echo "TARGET_EXTENSION=${TARGET_EXTENSION}" + - EXTENSION_NAME=$([ "$TARGET_EXTENSION" = "amazonq" ] && echo "Amazon Q" || echo "AWS Toolkit") + - VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);") + - CHANGELOG=$(cat packages/${TARGET_EXTENSION}/CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print if $. == 2') + - MESSAGE=$(envsubst < "$GITHUB_WORKSPACE/buildspec/release/notify.txt") + - DATA="{'Content':'${MESSAGE}'}" + - | + # TODO: Enable for prod only after testing + if [ "$STAGE" = "prod" ]; then + echo "SKIPPED (stage=${STAGE}): 'curl -v POST \"[SLACK_URL]\" -H \"Content-Type:application/json\" --data $DATA'" + exit 0 + fi + curl -v POST "${NOTIFY_URL}" -H "Content-Type:application/json" --data $DATA diff --git a/buildspec/release/notify.txt b/buildspec/release/notify.txt new file mode 100644 index 00000000000..6c1472a8be2 --- /dev/null +++ b/buildspec/release/notify.txt @@ -0,0 +1,6 @@ +Released ${EXTENSION_NAME} v${VERSION} for VSCode + +${CHANGELOG} + +Changelog: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/${TARGET_EXTENSION}/CHANGELOG.md +Release Arifact: https://github.com/aws/aws-toolkit-vscode/releases/tag/${TARGET_EXTENSION}/v${VERSION} \ No newline at end of file