Skip to content

Commit 8a2423f

Browse files
authored
ci: announce published releases in Slack (#1671)
* ci: announce published releases in Slack Posts each published GitHub Release to the release announcements channel, matching the Slack CLI and Node SDK workflows. * ci: move the release announcement into the release workflow
1 parent a853490 commit 8a2423f

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

‎.github/maintainers_guide.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ These `-SNAPSHOT` versions are intended to be overwritten. This enables develope
131131
* Click the "Generate release notes" button to list changes grouped by the labels in [`.github/release.yml`](./release.yml)
132132
* Edit the resulting notes to ensure they have decent messaging that is understandable by non-contributors, but each change should still have its own line
133133
* [Look at previous releases](https://github.com/slackapi/java-slack-sdk/releases) and follow their layouts
134-
* (Slack Internal) Communicate the release internally. Include a link to the GitHub Release(s).
134+
* (Slack Internal) Publishing the GitHub Release runs the notify job in the [release workflow](./workflows/release.yml), which posts the release internally. Check that the announcement appears.
135135
* (Slack Internal) Tweet? Not necessary for patch updates, might be needed for minor updates, definitely needed for
136136
major updates. Include a link to the GitHub Release(s).
137137
* Anticipate the next version as a SNAPSHOT

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
name: Release
22

33
on:
4+
release:
5+
types:
6+
- published
47
workflow_dispatch:
58

69
jobs:
710
publish:
811
name: Publish
9-
if: github.repository == 'slackapi/java-slack-sdk'
12+
if: github.event_name == 'workflow_dispatch' && github.repository == 'slackapi/java-slack-sdk'
1013
runs-on: ubuntu-latest
1114
environment: central
1215
permissions:
@@ -59,3 +62,20 @@ jobs:
5962
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
6063
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
6164
MAVEN_OPTS: "--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
65+
66+
notify:
67+
name: Notify
68+
if: github.event_name == 'release' && !github.event.release.prerelease && github.repository == 'slackapi/java-slack-sdk'
69+
runs-on: ubuntu-latest
70+
permissions:
71+
contents: read
72+
steps:
73+
- name: Notify Slack
74+
uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
75+
with:
76+
webhook: ${{ secrets.SLACK_RELEASE_ANNOUNCEMENTS_WEBHOOK_URL }}
77+
webhook-type: webhook-trigger
78+
payload: |
79+
action_url: "${{ github.event.release.html_url }}"
80+
message: "java-slack-sdk ${{ github.event.release.tag_name }}"
81+
repository: "${{ github.repository }}"

0 commit comments

Comments
 (0)