diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 5b44ce0e..26380164 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -139,24 +139,38 @@ jobs: pip install -U github3.py pep440_version_utils python3 ${GITHUB_WORKSPACE}/scripts/publish_gh_release_notes.py - - name: Get RASA SDK Version - env: - RASA_SDK_VERSION: ${{ github.ref }} + release-artifact-slack-notifications: + name: Release Analytics Artifact Slack Notifications + runs-on: ubuntu-22.04 + needs: [build_docker_image, deploy] + if: always() # Ensures this job runs regardless of the result of previous jobs + + steps: + - name: Set tag version run: | - echo "RASA_SDK_VERSION=${RASA_SDK_VERSION/refs\/tags\//}" >> $GITHUB_ENV + if [[ "$GITHUB_REF" == refs/tags/* ]]; then + echo "TAG_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + else + echo "No tag version found." + exit 1 + fi - - name: Notify Slack 💬 - if: success() - env: - SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_RELEASE_WEBHOOK }} - uses: Ilshidur/action-slack@2.1.0 + - name: Notify Slack of successful release 💬 + if: ${{ needs.build_docker_image.result == 'success' && needs.deploy.result == 'success' }} + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0 with: - args: "⚡ New *Rasa SDK* version ${{ env.RASA_SDK_VERSION }} has been released! Changelog: https://github.com/RasaHQ/rasa-sdk/blob/${{ env.RASA_SDK_VERSION }}/CHANGELOG.mdx" - - - name: Notify Slack of Failure ⛔ - if: failure() + # Send notification to #release slack channel + channel-id: "C024Z61K9QU" + slack-message: ":rocket: New *Rasa SDKe* version `${{ env.TAG_VERSION }}` has been released! More information can be found ." env: - SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ASSISTANT_DEV_TRIBE_WEBHOOK }} - uses: Ilshidur/action-slack@2.1.0 + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + - name: Notify Slack of unsuccessful release ⛔️ + if: ${{ needs.build_docker_image.result != 'success' || needs.deploy.result != 'success' }} + uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v 1.25.0 with: - args: "⛔️ *Rasa SDK* version ${{ env.RASA_SDK_VERSION }} could not be released 😱 GitHub Actions: https://github.com/RasaHQ/rasa-sdk/actions?query=branch%3A${{ env.RASA_SDK_VERSION }}" + # Send notification to #devtribe slack channel + channel-id: "C061J0LGHU0" + slack-message: ":broken_heart: *Rasa SDKe* release version `${{ env.TAG_VERSION }}` has failed! More information can be found ." + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}