Skip to content
Snippets Groups Projects

Add publish command

Merged poka requested to merge add-publish-command into master
1 file
+ 11
7
Compare changes
  • Side-by-side
  • Inline
+ 11
7
@@ -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
Loading