Skip to content

Commit

Permalink
ci: add post-release notification buildspec (aws#6609)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hayemaxi authored Feb 18, 2025
1 parent 5d26f9a commit aa0e949
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
28 changes: 28 additions & 0 deletions buildspec/release/80notify.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions buildspec/release/notify.txt
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit aa0e949

Please sign in to comment.