From 3cfe4ddd0ff10b96a1436bacbc89602c3fc8de8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Souchet=20C=C3=A9line?= <celine.souchet@bonitasoft.com>
Date: Tue, 27 Dec 2022 14:47:24 +0100
Subject: [PATCH 1/4] [FEAT] Add a new workflow to send message on twitter &
 discord, after release

---
 .github/workflows/announce-new-release.yml | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 .github/workflows/announce-new-release.yml

diff --git a/.github/workflows/announce-new-release.yml b/.github/workflows/announce-new-release.yml
new file mode 100644
index 0000000..40eb840
--- /dev/null
+++ b/.github/workflows/announce-new-release.yml
@@ -0,0 +1,46 @@
+name: Send a message on Twitter & Discord
+on:
+  workflow_dispatch:
+    inputs:
+      version:
+        description: 'The version to announce'
+        type: string
+        required: true
+      description:
+        description: 'A short description of the version to announce'
+        type: string
+        required: true
+
+jobs:
+  tweet:
+    runs-on: ubuntu-22.04
+    steps:
+      - name: Tweet
+        uses: snow-actions/tweet@v1.4.0
+        with:
+          status: |
+            📣 bpmnVisualizationR ${{ github.event.inputs.version }} is out! 🎉
+
+            ${{ github.event.inputs.description }}
+
+            #bpmnvisualization #bpmn #visualization #R #RLang #programming #opensource
+            ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ github.event.inputs.version }}
+        env:
+          CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
+          CONSUMER_API_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_API_SECRET_KEY }}
+          ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
+          ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
+
+  send-message-on-discord:
+    runs-on: ubuntu-22.04
+    steps:
+      - name: Send a message on Discord
+        uses: sarisia/actions-status-discord@v1
+        with:
+          webhook: ${{ secrets.DISCORD_WEBHOOK }}
+          nodetail: true
+          notimestamp: true
+          title: 📣 `bpmnVisualizationR` ${{ github.event.inputs.version }} is out! 🎉
+          url: ${{ github.server_url }}/${{ github.repository }}/releases/tag/v${{ github.event.inputs.version }}
+          description: ${{ github.event.inputs.description }}
+          color: 0xF9DADC

From ad6ee239b71ede2a64b586a18f640cc78ef687c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Souchet=20C=C3=A9line?=
 <4921914+csouchet@users.noreply.github.com>
Date: Thu, 29 Dec 2022 10:31:30 +0100
Subject: [PATCH 2/4] Update .github/workflows/announce-new-release.yml

---
 .github/workflows/announce-new-release.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/announce-new-release.yml b/.github/workflows/announce-new-release.yml
index 40eb840..e80bffb 100644
--- a/.github/workflows/announce-new-release.yml
+++ b/.github/workflows/announce-new-release.yml
@@ -1,4 +1,4 @@
-name: Send a message on Twitter & Discord
+name: Publish release news
 on:
   workflow_dispatch:
     inputs:

From e2622ce35f30031ffd6b2f047fe2471a53a20fe4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Souchet=20C=C3=A9line?= <celine.souchet@bonitasoft.com>
Date: Thu, 29 Dec 2022 10:55:25 +0100
Subject: [PATCH 3/4] Update the release documentation

---
 .github/workflows/announce-new-release.yml |  2 +-
 MAINTAINERS.md                             | 12 +++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/announce-new-release.yml b/.github/workflows/announce-new-release.yml
index e80bffb..b26b3ee 100644
--- a/.github/workflows/announce-new-release.yml
+++ b/.github/workflows/announce-new-release.yml
@@ -1,4 +1,4 @@
-name: Publish release news
+name: Announce new release
 on:
   workflow_dispatch:
     inputs:
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
index 2a319db..e2eb196 100644
--- a/MAINTAINERS.md
+++ b/MAINTAINERS.md
@@ -119,8 +119,15 @@ It conforms to [the CRAN Submission policies first](https://cran.r-project.org/w
 
 ## Communicate about the release
 
-**NOTE**: this is a very manual process today. For improvements, see [#130](https://github.com/process-analytics/bpmn-visualization-R/issues/130)
+- Open [github actions](https://github.com/process-analytics/bpmn-visualization-R/actions/workflows/announce-new-release.yml)
+- Click on the 'Run workflow' dropdown located on the right side of the page
+- Provide parameter values for _version_ and _description_
+- Click on the button 'Run workflow'
+- Make sure job execution was successful by checking the status
+- If all is good, you should see a new tweet on [ProcessAnalyti1](https://twitter.com/ProcessAnalyti1) and a new message on the [news](https://discord.com/channels/1011911769607913562/1024329159033499780) channel of Process Analytics server on Discord.
 
+___
+⚠️⚠️⚠️ _**Only if the [jobs](https://github.com/process-analytics/bpmn-visualization-R/actions/workflows/announce-new-release.yml) does NOT work!**_  ⚠️⚠️⚠️
 ### Twitter
 
 You can use this template:
@@ -144,3 +151,6 @@ You can use this template:
 > ===> some short description here <===
 >
 > https://github.com/process-analytics/bpmn-visualization-R/releases/tag/v{version}
+
+⚠️⚠️⚠️ _**End of the manual steps**_ ⚠️⚠️⚠️
+___

From fa7c110c8e7cbb08c15d6279f20f171b8c33813c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Souchet=20C=C3=A9line?= <celine.souchet@bonitasoft.com>
Date: Thu, 29 Dec 2022 11:14:29 +0100
Subject: [PATCH 4/4] Update the announce-new-release.yml to keep consistency
 with bpmn-visualization

---
 .github/workflows/announce-new-release.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/announce-new-release.yml b/.github/workflows/announce-new-release.yml
index b26b3ee..76f7481 100644
--- a/.github/workflows/announce-new-release.yml
+++ b/.github/workflows/announce-new-release.yml
@@ -12,10 +12,10 @@ on:
         required: true
 
 jobs:
-  tweet:
+  publish_tweet:
     runs-on: ubuntu-22.04
     steps:
-      - name: Tweet
+      - name: Publish a tweet
         uses: snow-actions/tweet@v1.4.0
         with:
           status: |
@@ -31,10 +31,10 @@ jobs:
           ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
           ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
 
-  send-message-on-discord:
+  publish_discord_post:
     runs-on: ubuntu-22.04
     steps:
-      - name: Send a message on Discord
+      - name: Publish a message on Discord
         uses: sarisia/actions-status-discord@v1
         with:
           webhook: ${{ secrets.DISCORD_WEBHOOK }}
