-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add release result send to slack (#3312)
* feat: add notify release result to slack * chore: change build image output result name --------- Co-authored-by: tison <[email protected]>
- Loading branch information
1 parent
2a26c01
commit 3bc0c4f
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,14 +330,14 @@ jobs: | |
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVELOP_CHANNEL }} | ||
steps: | ||
- name: Notifiy nightly build successful result | ||
- name: Notifiy dev build successful result | ||
uses: slackapi/[email protected] | ||
if: ${{ needs.release-images-to-dockerhub.outputs.build-result == 'success' }} | ||
with: | ||
payload: | | ||
{"text": "GreptimeDB's ${{ env.NEXT_RELEASE_VERSION }} build has completed successfully."} | ||
- name: Notifiy nightly build failed result | ||
- name: Notifiy dev build failed result | ||
uses: slackapi/[email protected] | ||
if: ${{ needs.release-images-to-dockerhub.outputs.build-result != 'success' }} | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,6 +240,11 @@ jobs: | |
disable-run-tests: ${{ env.DISABLE_RUN_TESTS }} | ||
artifacts-dir: ${{ matrix.artifacts-dir-prefix }}-${{ needs.allocate-runners.outputs.version }} | ||
|
||
- name: Set build macos result | ||
id: set-build-macos-result | ||
run: | | ||
echo "build-macos-result=success" >> $GITHUB_OUTPUT | ||
build-windows-artifacts: | ||
name: Build Windows artifacts | ||
strategy: | ||
|
@@ -276,6 +281,11 @@ jobs: | |
disable-run-tests: ${{ env.DISABLE_RUN_TESTS }} | ||
artifacts-dir: ${{ matrix.artifacts-dir-prefix }}-${{ needs.allocate-runners.outputs.version }} | ||
|
||
- name: Set build windows result | ||
id: set-build-windows-result | ||
run: | | ||
echo "build-windows-result=success" >> $GITHUB_OUTPUT | ||
release-images-to-dockerhub: | ||
name: Build and push images to DockerHub | ||
if: ${{ inputs.release_images || github.event_name == 'push' || github.event_name == 'schedule' }} | ||
|
@@ -299,6 +309,11 @@ jobs: | |
image-registry-password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
version: ${{ needs.allocate-runners.outputs.version }} | ||
|
||
- name: Set build image result | ||
id: set-image-build-result | ||
run: | | ||
echo "build-image-result=success" >> $GITHUB_OUTPUT | ||
release-cn-artifacts: | ||
name: Release artifacts to CN region | ||
if: ${{ inputs.release_images || github.event_name == 'push' || github.event_name == 'schedule' }} | ||
|
@@ -413,3 +428,27 @@ jobs: | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ vars.EC2_RUNNER_REGION }} | ||
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }} | ||
|
||
notification: | ||
if: ${{ always() }} # Not requiring successful dependent jobs, always run. | ||
name: Send notification to Greptime team | ||
needs: [ | ||
release-images-to-dockerhub | ||
] | ||
runs-on: ubuntu-20.04 | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_DEVELOP_CHANNEL }} | ||
steps: | ||
- name: Notifiy release successful result | ||
uses: slackapi/[email protected] | ||
if: ${{ needs.release-images-to-dockerhub.outputs.build-image-result == 'success' && needs.build-windows-artifacts.outputs.build-windows-result == 'success' && needs.build-macos-artifacts.outputs.build-macos-result == 'success' }} | ||
with: | ||
payload: | | ||
{"text": "GreptimeDB's release version ${{ needs.allocate-runners.outputs.version }} has completed successfully."} | ||
- name: Notifiy release failed result | ||
uses: slackapi/[email protected] | ||
if: ${{ needs.release-images-to-dockerhub.outputs.build-image-result != 'success' || needs.build-windows-artifacts.outputs.build-windows-result != 'success' || needs.build-macos-artifacts.outputs.build-macos-result != 'success' }} | ||
with: | ||
payload: | | ||
{"text": "GreptimeDB's release version ${{ needs.allocate-runners.outputs.version }} has failed, please check 'https://github.com/GreptimeTeam/greptimedb/actions/workflows/release.yml'."} |