Skip to content

Commit aa0e949

Browse files
authored
ci: add post-release notification buildspec (aws#6609)
Will enable for prod once I confirm it outputs the proper messages. --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 5d26f9a commit aa0e949

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

buildspec/release/80notify.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
nodejs: 20
7+
8+
pre_build:
9+
commands:
10+
# Check for implicit env vars passed from the release pipeline.
11+
- test -n "${NOTIFY_URL}"
12+
- test -n "${TARGET_EXTENSION}"
13+
14+
build:
15+
commands:
16+
- echo "TARGET_EXTENSION=${TARGET_EXTENSION}"
17+
- EXTENSION_NAME=$([ "$TARGET_EXTENSION" = "amazonq" ] && echo "Amazon Q" || echo "AWS Toolkit")
18+
- VERSION=$(node -e "console.log(require('./packages/${TARGET_EXTENSION}/package.json').version);")
19+
- CHANGELOG=$(cat packages/${TARGET_EXTENSION}/CHANGELOG.md | perl -ne 'BEGIN{$/="\n\n"} print if $. == 2')
20+
- MESSAGE=$(envsubst < "$GITHUB_WORKSPACE/buildspec/release/notify.txt")
21+
- DATA="{'Content':'${MESSAGE}'}"
22+
- |
23+
# TODO: Enable for prod only after testing
24+
if [ "$STAGE" = "prod" ]; then
25+
echo "SKIPPED (stage=${STAGE}): 'curl -v POST \"[SLACK_URL]\" -H \"Content-Type:application/json\" --data $DATA'"
26+
exit 0
27+
fi
28+
curl -v POST "${NOTIFY_URL}" -H "Content-Type:application/json" --data $DATA

buildspec/release/notify.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Released ${EXTENSION_NAME} v${VERSION} for VSCode
2+
3+
${CHANGELOG}
4+
5+
Changelog: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/${TARGET_EXTENSION}/CHANGELOG.md
6+
Release Arifact: https://github.com/aws/aws-toolkit-vscode/releases/tag/${TARGET_EXTENSION}/v${VERSION}

0 commit comments

Comments
 (0)