From e0934057cb549541ea4661d049259204eab63604 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Wed, 3 Jan 2024 16:43:12 +0100
Subject: [PATCH] fix: test gorelease

---
 .gitlab-ci.yml         |  9 +++++----
 .goreleaser.yml        |  1 +
 devenv.nix             | 21 ++++++++++++++-------
 source/.goreleaser.yml |  1 -
 4 files changed, 20 insertions(+), 12 deletions(-)
 create mode 120000 .goreleaser.yml
 delete mode 120000 source/.goreleaser.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3323ec2..a6ca077 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -31,14 +31,15 @@ release:
   tags:
     - nixos
   stage: release
-  image:
-    name: goreleaser/goreleaser
-    entrypoint: [""]
+  #image:
+  #  name: goreleaser/goreleaser
+  #  entrypoint: [""]
   only:
     - tags
   variables:
     # Disable shallow cloning so that goreleaser  can diff between tags to
     GIT_DEPTH: 0
   script:
-    - cd source; goreleaser release --clean
+    - devenv shell deploy-app
+    #- cd source; goreleaser release --clean
 
diff --git a/.goreleaser.yml b/.goreleaser.yml
new file mode 120000
index 0000000..2c0f63a
--- /dev/null
+++ b/.goreleaser.yml
@@ -0,0 +1 @@
+/nix/store/q73fwxvz5m9r7n2iyfsmkj9hs8zwr9vd-goreleaser.yml
\ No newline at end of file
diff --git a/devenv.nix b/devenv.nix
index 5e05578..c618cb1 100644
--- a/devenv.nix
+++ b/devenv.nix
@@ -73,16 +73,17 @@ tasks:
        tags:
          - nixos
        stage: release
-       image:
-         name: goreleaser/goreleaser
-         entrypoint: [""]
+       #image:
+       #  name: goreleaser/goreleaser
+       #  entrypoint: [""]
        only:
          - tags
        variables:
          # Disable shallow cloning so that goreleaser  can diff between tags to
          GIT_DEPTH: 0
        script:
-         - cd source; goreleaser release --clean
+         - devenv shell deploy-app
+         #- cd source; goreleaser release --clean
      
      '';
      };
@@ -132,8 +133,8 @@ builds:
 #      - windows_amd64_v1
 #      - windows_arm64
 #      - windows_386
-#    dir: source
-#    main: source/main.go
+    dir: source
+    main: source/main.go
 #    binary: version
 #    builder: go
 #    gobinary: go
@@ -267,7 +268,7 @@ builds:
 
     # Usage for Taskfile.yaml
     update_symlink "${config.devenv.root}/Taskfile.yaml" "${taskfileYaml}"
-    update_symlink "${config.devenv.root}/source/.goreleaser.yml" "${goReleaserYaml}"
+    update_symlink "${config.devenv.root}/.goreleaser.yml" "${goReleaserYaml}"
     
     cat ${gitlabCiYaml} > "${config.devenv.root}/.gitlab-ci.yml"
 
@@ -288,6 +289,12 @@ builds:
 ${pkgs.nix}/bin/nix build .#version
   
   '';
+  
+  scripts.deploy-app.exec =  ''
+#!${pkgs.bash}/bin/bash
+${pkgs.goreleaser}/bin/goreleaser release --clean --config ${config.devenv.root}/.goreleaser.yml
+  
+  '';
     
 #  # This script is executed when the app is built
 #  # You can use it to build the app  
diff --git a/source/.goreleaser.yml b/source/.goreleaser.yml
deleted file mode 120000
index 55cb5da..0000000
--- a/source/.goreleaser.yml
+++ /dev/null
@@ -1 +0,0 @@
-/nix/store/sbjx6h6bhcrz5jic704d188l0jqr8051-goreleaser.yml
\ No newline at end of file
-- 
GitLab