|
5 | 5 | types: [published] |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - github-release-notification: |
9 | | - name: Notify Discord and Slack of New Release |
10 | | - runs-on: ubuntu-24.04 |
11 | | - steps: |
12 | | - # Create a GitHub App token for authentication with higher rate limits |
13 | | - - uses: actions/create-github-app-token@v1 |
14 | | - id: app-token |
15 | | - with: |
16 | | - app-id: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_APP_ID }} |
17 | | - private-key: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_PRIVATE_KEY }} |
18 | | - |
19 | | - # Checkout the repository code |
20 | | - - name: Checkout |
21 | | - uses: actions/checkout@v4 |
22 | | - |
23 | | - # Install GitHub CLI to interact with GitHub API |
24 | | - - name: Install GitHub CLI |
25 | | - run: sudo apt-get install -y gh |
26 | | - |
27 | | - # Fetch the latest release information using GitHub CLI |
28 | | - - name: Fetch Latest Release |
29 | | - id: latest_release |
30 | | - env: |
31 | | - GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} |
32 | | - run: | |
33 | | - RAW_RELEASE=$(gh release list --repo $GITHUB_REPOSITORY --limit 1 --json tagName --jq '.[0].tagName') |
34 | | - echo "Raw release: $RAW_RELEASE" |
35 | | - echo "tag=$RAW_RELEASE" >> $GITHUB_OUTPUT |
36 | | -
|
37 | | - # Send release notification to Discord (skip beta releases) |
38 | | - - name: Releases to Discord |
39 | | - uses: SethCohen/github-releases-to-discord@v1.16.2 |
40 | | - if: ${{ !contains(github.ref, '-beta.') }} |
41 | | - with: |
42 | | - webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }} |
43 | | - color: "2105893" # Green color |
44 | | - username: "Release Changelog" |
45 | | - content: "<@&1346912737380274176>" # Mention specific Discord role |
46 | | - footer_timestamp: true |
47 | | - |
48 | | - # Send release notification to Slack |
49 | | - - name: Notify Slack of New Release |
50 | | - uses: rtCamp/action-slack-notify@v2 |
51 | | - env: |
52 | | - SLACK_CHANNEL: "lerian-product-release" |
53 | | - SLACK_COLOR: "#36a64f" # Green color |
54 | | - SLACK_ICON_EMOJI: ":rocket" |
55 | | - SLACK_TITLE: "Midaz New Release: ${{ steps.latest_release.outputs.tag }}" |
56 | | - SLACK_MESSAGE: "🎉 *New Release Published!* \n \n <https://github.com/${{ github.repository }}/releases/tag/${{ steps.latest_release.outputs.tag }} | *Click here for details*>" |
57 | | - SLACK_WEBHOOK: ${{ secrets.RELEASE_WEBHOOK_NOTIFICATION_URL }} |
| 8 | + notify: |
| 9 | + uses: LerianStudio/github-actions-shared-workflows/.github/workflows/release-notification.yml@develop |
| 10 | + with: |
| 11 | + product_name: "Midaz" |
| 12 | + slack_channel: "lerian-product-release" |
| 13 | + discord_content: "<@&1346912737380274176>" |
| 14 | + secrets: |
| 15 | + APP_ID: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_APP_ID }} |
| 16 | + APP_PRIVATE_KEY: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_PRIVATE_KEY }} |
| 17 | + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} |
| 18 | + SLACK_WEBHOOK_URL: ${{ secrets.RELEASE_WEBHOOK_NOTIFICATION_URL }} |
0 commit comments