From 3b8e6da2d942b0546ca50a1deb8742320d8e60a9 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Wed, 19 Jun 2024 12:15:20 +0200
Subject: [PATCH] fix: no code fix; only release and publish process

---
 nix/scripts/release.nix | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/nix/scripts/release.nix b/nix/scripts/release.nix
index 6d38cbac5..dd1b8c4e4 100644
--- a/nix/scripts/release.nix
+++ b/nix/scripts/release.nix
@@ -58,14 +58,20 @@ in
     export MNEMONIC=$(echo $NAME | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]//g')
     ${pkgs'.envsubst}/bin/envsubst < ./nix/config/release.nix.template > ./nix/config/release.nix
     
-    ${pkgs'.nodejs_22}/bin/npm version "$gitVersion"
-
+    if ! ${pkgs'.nodejs_22}/bin/npm version "$gitVersion" --no-git-tag-version; then
+        echo_fail "Error: Could not write project version."
+        exit 1
+    fi
 
     ${pkgs'.git}/bin/git tag -a $gitVersion -m"chore: bump version to $gitVersion"
     ${updateChangelogScript}/bin/update-changelog
     cd $CI_PROJECT_DIR || exit 1
 
-    ${pkgs'.git}/bin/git tag -d "$gitVersion"
+    if ! ${pkgs'.git}/bin/git tag -d "$gitVersion"  2>/dev/null; then
+        echo_fail "Error: Could not delete git tag $gitVersion."
+        exit 1
+    fi
+    
     ${pkgs'.git}/bin/git commit -m "chore: release $gitVersion" CHANGELOG.md ./nix/config/release.nix package.json
 
     ${pkgs'.git}/bin/git tag -a $gitVersion -m"chore: bump version to $gitVersion"
-- 
GitLab