From c304f5edb89d4b7a80ed4a4f1d738d27e4e5f93f Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 6 Dec 2023 14:19:41 -0700 Subject: [PATCH 1/2] Split stable notification into two steps --- .github/workflows/notify.yml | 19 +++++++++++++++++++ .github/workflows/stable.yml | 19 ++++++------------- 2 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/notify.yml diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml new file mode 100644 index 000000000..703261b14 --- /dev/null +++ b/.github/workflows/notify.yml @@ -0,0 +1,19 @@ +name: notify on release +on: + release: + types: [released] + +jobs: + notify: + name: Notify the stable channel + runs-on: ubuntu-20.04 + steps: + - name: Send notification to Discord + uses: ./.github/actions/discord-send + with: + channel: ${{ secrets.DISCORD_STABLE_CHANNEL_ID }} + token: ${{ secrets.DISCORD_STABLE_CHANNEL_TOKEN }} + title: New Toltec stable update available + link: https://toltec-dev.org/stable + color: 0x2ea043 + message: ${{ github.event.release.body }} diff --git a/.github/workflows/stable.yml b/.github/workflows/stable.yml index 62a06e427..9d22b423b 100644 --- a/.github/workflows/stable.yml +++ b/.github/workflows/stable.yml @@ -28,21 +28,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} - name: Create Github Release - continue-on-error: true run: | - sudo apt-get update && sudo apt-get install -y hub - hub release create -t $SHA -m $MESSAGE $(date +%G-W%V-%u) + gh release create \ + --draft \ + --target "$SHA" \ + --title "$(echo $MESSAGE | head -n 1)" \ + --notes "$(echo $MESSAGE | tail -n +2)" \ + $(date +%G-W%V-%u) env: SHA: ${{ github.sha }} GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} MESSAGE: ${{ github.event.commits[0].message }} - - name: Send notification to Discord - continue-on-error: true - uses: ./.github/actions/discord-send - with: - channel: ${{ secrets.DISCORD_STABLE_CHANNEL_ID }} - token: ${{ secrets.DISCORD_STABLE_CHANNEL_TOKEN }} - title: New Toltec stable update available - link: https://toltec-dev.org/stable - color: 0x2ea043 - message: ${{ github.event.commits[0].message }} From 11e38f5b6c0c986ce9497a5fa21e423525968051 Mon Sep 17 00:00:00 2001 From: Nathaniel van Diepen Date: Wed, 6 Dec 2023 14:48:59 -0700 Subject: [PATCH 2/2] Link to release instead of website --- .github/workflows/notify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 703261b14..4c997b9bf 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -14,6 +14,6 @@ jobs: channel: ${{ secrets.DISCORD_STABLE_CHANNEL_ID }} token: ${{ secrets.DISCORD_STABLE_CHANNEL_TOKEN }} title: New Toltec stable update available - link: https://toltec-dev.org/stable + link: ${{ github.event.release.url }} color: 0x2ea043 message: ${{ github.event.release.body }}