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 c8e63df
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/build-gradle.yml
Expand Up @@ -28,6 +28,15 @@ 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
Expand Down Expand Up @@ -83,7 +92,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 +118,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
when: ${{ !!secret.zulip_api_key && 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 }}
47 changes: 47 additions & 0 deletions .github/workflows/release-gradle.yml
Expand Up @@ -23,6 +23,15 @@ 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
Expand Down Expand Up @@ -51,6 +60,25 @@ jobs:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}

- name: Zulip notification
uses: zulip/github-actions-zulip/send-message@v1
when: ${{ !!secret.zulip_api_key && 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 +92,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
when: ${{ !!secret.zulip_api_key && 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 c8e63df

Please sign in to comment.