Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/resources/slack-payloads/slack-message-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"attachments": [
{
"pretext": "{{ env.PRE_TEXT_MESSAGE }}",
"fallback": "{{ env.FALLBACK_MESSAGE }}",
"color": "{{ env.COLOR }}",
"author_name": "{{ github.workflow }}",
"author_link": "{{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}/actions/runs/{{ env.GITHUB_RUN_ID }}",
"title": "{{ env.GITHUB_REPOSITORY }}",
"title_link": "{{ env.GITHUB_SERVER_URL }}/{{ env.GITHUB_REPOSITORY }}",
"fields": [
{
"title": "Release Tag",
"short": true,
"value": "{{ env.RELEASETAG }}"
}
],
"footer": "deployed by: {{ github.actor }}",
"footer_icon": "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
}
]
}
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,39 @@ jobs:
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}

post-release:
name: Post Release Actions

runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- generate-version
- publish

steps:
- name: Slack - Success Message
uses: DSdatsme/slack-github-action@env_support
if: ${{ success() && needs.publish.result == 'success' }}
with:
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
payload-file-path: ./.github/resources/slack-payloads/slack-message-template.json
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
RELEASETAG: ${{ needs.generate-version.outputs.new_version }}
PRE_TEXT_MESSAGE: "Workflow Passed! :successkid:"
FALLBACK_MESSAGE: "Workflow Passed!"
COLOR: "good"

- name: Slack - Failure Message
uses: DSdatsme/slack-github-action@env_support
if: ${{ failure() || needs.publish.result != 'success' }}
with:
channel-id: ${{ vars.SLACK_CHANNEL_ID }}
payload-file-path: ./.github/resources/slack-payloads/slack-message-template.json
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
RELEASETAG: ${{ needs.generate-version.outputs.new_version }}
PRE_TEXT_MESSAGE: "<!channel> Workflow Failed! :x:"
FALLBACK_MESSAGE: "Workflow Failed!"
COLOR: "danger"