From 8fc8c0e87ae2adcd771e5b762e22a91c57d03b7b Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Thu, 1 Feb 2024 13:05:01 +0100
Subject: [PATCH] WIP: test

---
 .gitlab-ci.yml | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b7e5dfb..c500a37 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,19 +25,23 @@ build:
     paths:
       - target/release
   # only build gcli when adding a tag
-  only:
-    - tags
+  # only:
+  #   - tags
 
 release:
   stage: release
-  image: rust
+  image: registry.gitlab.com/gitlab-org/release-cli:latest
   script:
     - echo "Creating a release..."
+    - CI_COMMIT_TAG="0.2.2"
+    - apt-get update && apt-get install -y git
+    - LAST_VERSION="$(git describe --tags --abbrev=0)"
+    - RELEASE_DESCRIPTION="$(git log --pretty='format:- %s ([%h]($CI_PROJECT_URL/-/commit/%h)) ' HEAD...$LAST_VERSION --reverse)"
   # 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"
+    name: "v$CI_COMMIT_TAG"
+    description: "Latest changes:\n$RELEASE_DESCRIPTION"
     # Set the tag for the release
     tag_name: "$CI_COMMIT_TAG"
     # Attach the artifact to the release
@@ -46,8 +50,8 @@ release:
         - 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
+  # only:
+  #   - tags
   # Not necessary but clearly shows the dependency
   dependencies:
     - build
-- 
GitLab