Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

ci: Slack notifications on release start and success with itinerary (#1463)

Mish Ushakove03d1b88fc4a
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 269b6928b..e94858aea 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -58,6 +58,7 @@ jobs:
js-sdk: ${{ steps.js.outputs.release }}
python-sdk: ${{ steps.python.outputs.release }}
cli: ${{ steps.cli.outputs.release }}
+ itinerary: ${{ steps.itinerary.outputs.itinerary }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
@@ -118,6 +119,26 @@ jobs:
IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "@e2b/cli")
echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
+ - name: Build release itinerary
+ id: itinerary
+ if: steps.version.outputs.release == 'true'
+ run: |
+ pnpm changeset status --output=.cs-status.json
+ ITINERARY=$(node -e '
+ const data = require("./.cs-status.json");
+ const labels = { "e2b": "JS SDK (e2b)", "@e2b/python-sdk": "Python SDK (e2b)", "@e2b/cli": "CLI (@e2b/cli)" };
+ const order = ["e2b", "@e2b/python-sdk", "@e2b/cli"];
+ const byName = Object.fromEntries(data.releases.map(r => [r.name, r]));
+ const lines = order.filter(n => byName[n]).map(n => `• ${labels[n]} v${byName[n].newVersion}`);
+ process.stdout.write(lines.join("\n") || "• No packages were published");
+ ')
+ rm -f .cs-status.json
+ {
+ echo "itinerary<<EOF"
+ echo "$ITINERARY"
+ echo "EOF"
+ } >> "$GITHUB_OUTPUT"
+
python-tests:
name: Python SDK Tests
needs: [preflight]
@@ -146,6 +167,25 @@ jobs:
uses: ./.github/workflows/publish_packages.yml
secrets: inherit
+ report-start:
+ needs: [preflight]
+ if: needs.preflight.outputs.release == 'true'
+ name: Release Started - Slack Notification
+ runs-on: ubuntu-latest
+ steps:
+ - name: Release Started - Slack Notification
+ uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58 # v2.4.0
+ env:
+ SLACK_COLOR: '#3aa3e3'
+ SLACK_MESSAGE: |
+ :rocket: A new release has been triggered :hourglass_flowing_sand:
+
+ *Releasing:*
+ ${{ needs.preflight.outputs.itinerary }}
+ SLACK_TITLE: Release Started
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
+ SLACK_CHANNEL: 'monitoring-releases'
+
report-failure:
needs: [python-tests, js-tests, cli-tests, publish]
if: failure()
@@ -153,7 +193,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release Failed - Slack Notification
- uses: rtCamp/action-slack-notify@v2
+ uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58 # v2.4.0
env:
SLACK_COLOR: '#ff0000'
SLACK_MESSAGE: ':here-we-go-again: :bob-the-destroyer: We need :fix-parrot: ASAP :pray:'
@@ -161,6 +201,25 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: 'monitoring-releases'
+ report-success:
+ needs: [preflight, publish]
+ if: needs.publish.result == 'success'
+ name: Release Succeeded - Slack Notification
+ runs-on: ubuntu-latest
+ steps:
+ - name: Release Succeeded - Slack Notification
+ uses: rtCamp/action-slack-notify@33ca3be66c6f378fe1610fd1d5258632dbed5e58 # v2.4.0
+ env:
+ SLACK_COLOR: '#36a64f'
+ SLACK_MESSAGE: |
+ :tada: A new version has been released successfully! :ship-it-parrot:
+
+ *Released:*
+ ${{ needs.preflight.outputs.itinerary }}
+ SLACK_TITLE: Release Succeeded
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
+ SLACK_CHANNEL: 'monitoring-releases'
+
# ── Release candidate ────────────────────────────────────
rc-validate:
name: Validate RC inputs