From 3a083c45f0bf54647c2b03c206ac38adf11022f2 Mon Sep 17 00:00:00 2001
From: Thomas Vaillant <8985674+thomvaill@users.noreply.github.com>
Date: Tue, 29 Oct 2024 19:42:42 +0100
Subject: [PATCH] fix: alpha releases

---
 .github/workflows/build.yml                  |  2 +-
 .github/workflows/post-release-e2e-alpha.yml | 34 ++++++++++++++++++++
 .github/workflows/post-release-e2e.yml       |  1 +
 docker/Dockerfile                            |  2 +-
 lerna.json                                   |  2 +-
 5 files changed, 38 insertions(+), 3 deletions(-)
 create mode 100644 .github/workflows/post-release-e2e-alpha.yml

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 2d4c70f1..d83be752 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -251,7 +251,7 @@ jobs:
           git config --global user.name 'github-actions[bot]'
           git config --global user.email 'github-actions[bot]@users.noreply.github.com'
       - name: release and publish to NPM
-        run: yarn lerna publish --yes --conventional-commits --conventional-prerelease --exact --create-release github
+        run: yarn lerna publish --yes --conventional-commits --conventional-prerelease --dist-tag alpha --exact --create-release github
         env:
           NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/post-release-e2e-alpha.yml b/.github/workflows/post-release-e2e-alpha.yml
new file mode 100644
index 00000000..d3105bdf
--- /dev/null
+++ b/.github/workflows/post-release-e2e-alpha.yml
@@ -0,0 +1,34 @@
+name: Post-release E2E alpha
+on:
+  workflow_dispatch:
+
+  # Run after every release to NPM
+  push:
+    tags:
+      - v*
+
+jobs:
+  e2e:
+    strategy:
+      matrix:
+        os: [ubuntu-latest, windows-latest, macos-latest]
+        node-version:
+          - 20.x # Active LTS (https://github.com/nodejs/release)
+          - 18.x # Maintenance LTS
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: use node.js ${{ matrix.node-version }}
+        uses: actions/setup-node@v1
+        with:
+          node-version: ${{ matrix.node-version }}
+          registry-url: https://registry.npmjs.org/
+
+      - name: install
+        run: npm install -g log4brains@alpha
+
+      - name: test # TODO: test the preview add some assertions :-) For now we just check the exit codes. Or manage to run e2e-tests/e2e-launcher.js from here
+        run: |
+          log4brains --version
+          log4brains init --defaults
+          log4brains adr list
+          log4brains build
diff --git a/.github/workflows/post-release-e2e.yml b/.github/workflows/post-release-e2e.yml
index 1c5e3ff1..6b7287e0 100644
--- a/.github/workflows/post-release-e2e.yml
+++ b/.github/workflows/post-release-e2e.yml
@@ -33,6 +33,7 @@ jobs:
 
       - name: test # TODO: test the preview add some assertions :-) For now we just check the exit codes. Or manage to run e2e-tests/e2e-launcher.js from here
         run: |
+          log4brains --version
           log4brains init --defaults
           log4brains adr list
           log4brains build
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 425be3f0..ab7bdb8b 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:14.18-alpine3.14
+FROM node:lts-alpine
 
 ARG LOG4BRAINS_VERSION
 
diff --git a/lerna.json b/lerna.json
index f03da586..87927815 100644
--- a/lerna.json
+++ b/lerna.json
@@ -7,7 +7,7 @@
   ],
   "command": {
     "version": {
-      "message": "chore(release): publish %s",
+      "message": "chore(release): publish %s [skip ci]",
       "allowBranch": "develop"
     }
   }