diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b7e5dfb28052c61f03b52eb507e30a770689aa39..c500a37346637340b863a960f9f594777fac7521 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