From 8362732f864541be750e87b54c35d71e1ab9df93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas94@gmx.net>
Date: Sun, 8 Jan 2023 11:24:34 +0100
Subject: [PATCH] CI: keep `continuous` tag in sync with development release

---
 .github/workflows/main.yml | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index afeb64d..c1ca800 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -164,14 +164,31 @@ jobs:
         uses: actions/download-artifact@v3
       - name: Package
         run: for i in */; do zip -r "${i%/}.zip" "$i"; done
+      - name: Advance tag
+        uses: actions/github-script@v3
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            try {
+                await github.git.deleteRef({
+                  owner: context.repo.owner,
+                  repo: context.repo.repo,
+                  ref: "tags/continuous"
+                })
+            } catch (e) {}
+            await github.git.createRef({
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              ref: "refs/tags/continuous",
+              sha: context.sha
+            })
       - name: Update release
         uses: ncipollo/release-action@v1
         with:
           allowUpdates: true
           artifacts: "*.zip"
-          commit: "${{ github.sha }}"
           omitBody: true
           omitName: true
-          omitPrereleaseDuringUpdate: true
+          prerelease: true
           tag: "continuous"
           updateOnlyUnreleased: true
-- 
GitLab