Skip to content

Commit

Permalink
feat: Add Zulip notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
grossws committed Mar 23, 2023
1 parent 54d5c55 commit 1599746
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/build-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,22 @@ on:
nexus_password:
description: Nexus password
required: true
zulip_api_key:
description: Zulip bot api key
required: false
zulip_email:
description: Zulip bot email
required: false
zulip_url:
description: Zulip organization URL
required: false

permissions:
contents: read

env:
ZULIP_URL: ${{ secrets.zulip_url }}

jobs:
wrapper:
name: Validate Gradle Wrapper
Expand Down Expand Up @@ -83,7 +95,7 @@ jobs:
pull_request:*) TYPE="PR" ;;
*) TYPE="Tag" ;;
esac
echo "REF_DESC=${TYPE} <${URL}|\`${ID}\`>" >> ${GITHUB_ENV}
echo "REF_DESC=${TYPE} [\`${ID}\`](${URL})" >> ${GITHUB_ENV}
env:
CONFIGURATION_CACHE: ${{ inputs.use-configuration-cache }}

Expand All @@ -109,3 +121,20 @@ jobs:
-PnexusUrl=${{ secrets.nexus_url }} \
-PnexusUsername=${{ secrets.nexus_username }} \
-PnexusPassword=${{ secrets.nexus_password }}
- name: Zulip notification
uses: zulip/github-actions-zulip/send-message@v1
if: ${{ !!env.ZULIP_URL && always() }}
with:
api-key: ${{ secrets.zulip_api_key }}
email: ${{ secrets.zulip_email }}
organization-url: ${{ secrets.zulip_url }}
type: stream
to: dev
topic: GitHub Notifications
content: |
**${{ github.repository }}** build *${{ job.status }}*: ${{ env.REF_DESC }}
JDK: *${{ inputs.java-version }}* (${{ inputs.java-distribution }})
Workflow run ${{ env.BASE_URL }}/actions/runs/${{ github.run_id }}
50 changes: 50 additions & 0 deletions .github/workflows/release-gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,22 @@ on:
nexus_password:
description: Nexus password
required: true
zulip_api_key:
description: Zulip bot api key
required: false
zulip_email:
description: Zulip bot email
required: false
zulip_url:
description: Zulip organization URL
required: false

permissions:
contents: read

env:
ZULIP_URL: ${{ secrets.zulip_url }}

jobs:
release:
name: Release
Expand All @@ -51,6 +63,25 @@ jobs:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}

- name: Zulip notification
uses: zulip/github-actions-zulip/send-message@v1
if: ${{ !!env.ZULIP_URL && always() }}
with:
api-key: ${{ secrets.zulip_api_key }}
email: ${{ secrets.zulip_email }}
organization-url: ${{ secrets.zulip_url }}
type: stream
to: dev
topic: GitHub Notifications
content: |
**${{ github.repository }}** release ${{ github.ref_name }} *started*
Release [`${{ github.ref_name }}`](${{ env.BASE_URL }}/tree/${{ github.ref_name }})
JDK: *${{ inputs.java-version }}* (${{ inputs.java-distribution }})
Workflow run ${{ env.BASE_URL }}/actions/runs/${{ github.run_id }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
Expand All @@ -64,3 +95,22 @@ jobs:
-PnexusUrl=${{ secrets.nexus_url }} \
-PnexusUsername=${{ secrets.nexus_username }} \
-PnexusPassword=${{ secrets.nexus_password }}
- name: Zulip notification
uses: zulip/github-actions-zulip/send-message@v1
if: ${{ !!env.ZULIP_URL && always() }}
with:
api-key: ${{ secrets.zulip_api_key }}
email: ${{ secrets.zulip_email }}
organization-url: ${{ secrets.zulip_url }}
type: stream
to: dev
topic: GitHub Notifications
content: |
**${{ github.repository }}** release ${{ github.ref_name }} *${{ job.status }}*
Release [`${{ github.ref_name }}`](${{ env.BASE_URL }}/tree/${{ github.ref_name }})
JDK: *${{ inputs.java-version }}* (${{ inputs.java-distribution }})
Workflow run ${{ env.BASE_URL }}/actions/runs/${{ github.run_id }}

0 comments on commit 1599746

Please sign in to comment.