From 1d9cd7ac5ce5270d9360c27e4104c0c1e3d8216e Mon Sep 17 00:00:00 2001
From: Philipp Stadler <hello@phstadler.com>
Date: Thu, 18 Jul 2024 14:47:09 +0200
Subject: [PATCH] feat: add whatsapp

---
 .gitlab-ci.yml        | 26 +++++++++++++++++++++++---
 pack-build/Dockerfile | 16 ++++++++++++++++
 2 files changed, 39 insertions(+), 3 deletions(-)
 create mode 100644 pack-build/Dockerfile

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 972c8d2..26d23e1 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,10 +1,12 @@
-image: durcheinander/export-apkgs:1.0.0
+image: durcheinander/pack-build:1.0.0
 
 stages:
 - build
 - release
+- notify
 
 build:
+  image: durcheinander/export-apkgs:1.0.0
   stage: build
   rules:
     - if: $CI_PIPELINE_SOURCE == "schedule"
@@ -92,6 +94,7 @@ release-package-json-version-as-git-tag:
     - if: $CI_COMMIT_BRANCH == "main"
   # we don't need anything in node_modules or python, so don't fetch the cache
   cache: []
+  resource_group: repository
   script:
     - NPM_VERSION=$(grep '"version":' package.json -m 1 | cut -d '"' -f 4)
     # || exit_code=$? is the recommended way to ignore a non-zero exit code
@@ -116,8 +119,6 @@ create-gitlab-release:
   needs:
     - job: build
       artifacts: true
-    - job: changelog
-      artifacts: true
     - job: release-notes
       artifacts: true
   variables:
@@ -135,3 +136,22 @@ create-gitlab-release:
       links:
         - name: 'Browse all APKGS…'
           url: '$ARTIFACTS_URL'
+
+send-release-notes-to-group:
+  stage: notify
+  resource_group: whatsapp
+  rules:
+    - if: $CI_COMMIT_TAG
+  needs:
+    - job: release-notes
+      artifacts: true
+  variables:
+    # we just need the artifacts and don't need up-to-date source, so don't even fetch
+    GIT_STRATEGY: none
+    MUDSLIDE_CACHE_FOLDER: './mudslide_cache'
+  cache:
+    - mudslide_cache
+  script:
+    - mkdir -p mudslide_cache
+    - mudslide login
+    - mudslide send $WHATSAPP_RELEASE_NOTIFY_RECIPIENT "$(cat RELEASE_NOTES.md)"
diff --git a/pack-build/Dockerfile b/pack-build/Dockerfile
new file mode 100644
index 0000000..9b6c82a
--- /dev/null
+++ b/pack-build/Dockerfile
@@ -0,0 +1,16 @@
+FROM debian:12.4
+
+RUN apt-get update && apt-get install -y \
+faketime \
+git \
+make \
+nodejs \
+npm \
+pipenv \
+python3 \
+python3-pip \
+zip \
+curl
+RUN npm install --global \
+yarn \
+mudslide
-- 
GitLab