diff --git a/.github/workflows/build-gradle.yml b/.github/workflows/build-gradle.yml index c2745f8..32adc95 100644 --- a/.github/workflows/build-gradle.yml +++ b/.github/workflows/build-gradle.yml @@ -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 @@ -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 }} @@ -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 }} diff --git a/.github/workflows/release-gradle.yml b/.github/workflows/release-gradle.yml index c1a4cf8..0acb04c 100644 --- a/.github/workflows/release-gradle.yml +++ b/.github/workflows/release-gradle.yml @@ -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 @@ -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: @@ -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 }}