From de184b292a63f454d81428f54c4a546567211783 Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Thu, 1 Feb 2024 11:59:08 +0100
Subject: [PATCH] add vit proposition to publish artefact without gitlab API

But I wanna keep my bunty for sure, it's mine.
---
 .gitlab-ci.yml | 27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7455338..b7e5dfb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,11 +19,11 @@ build:
       - target/release/gcli
   # use cache to avoid re-downloading and re-building all dependencies
   cache:
-    - key:
-        files:
-          - Cargo.lock
-      paths:
-        - target/release
+    key:
+      files:
+        - Cargo.lock
+    paths:
+      - target/release
   # only build gcli when adding a tag
   only:
     - tags
@@ -32,9 +32,22 @@ release:
   stage: release
   image: rust
   script:
-    - chmod +x .ci/release_script.sh
-    - .ci/release_script.sh
+    - echo "Creating a release..."
+  # Define release parameters
+  release:
+    # Release name and description using the tag name
+    name: "Release $CI_COMMIT_TAG"
+    description: "Automatically created release for v$CI_COMMIT_TAG"
+    # Set the tag for the release
+    tag_name: "$CI_COMMIT_TAG"
+    # Attach the artifact to the release
+    assets:
+      links:
+        - name: "gcli v$CI_COMMIT_TAG for Linux"
+          url: "$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/raw/target/release/gcli?job=build"
+  # Trigger release creation only for tagged commits
   only:
     - tags
+  # Not necessary but clearly shows the dependency
   dependencies:
     - build
-- 
GitLab