It seems like !19298 (merged) added release field in gitlab-ci.yml, but the example configuration cant pass the "CI Lint" with an error message "jobs:release configrelease features are not enabled: release".
My yml:
image:golang:1.13cache:paths:-/go/pkgstages:-releaserelease:stage:releaseonly:tagsscript:-make changelog | tee release_changelog.txtrelease:name:Release $CI_TAG_NAMEtag_name:v0.06description:./release_changelog.txtassets:links:-name:cool-app.zipurl:http://my.awesome.download.site/1.0-$CI_COMMIT_SHORT_SHA.zip-name:cool-app.exeurl:http://my.awesome.download.site/1.0-$CI_COMMIT_SHORT_SHA.exe
Notes
Feature introduced in GitLab %13.2 and is now generally available on gitlab.com.
For self-managed instances, GitLab 13.2 and GitLab runner v13.2.0 are required.
@jmeshell Any idea on a timeline when this feature might be turned on for gitlab.com? I really like the idea of automatic creating releases out of my CI pipeline and this definitely would make it super simple.
Same here. I assumed its enabled as its documented and with a version remark in the docs. But when trying it I got the feature not enabled error message.
Forgot to inform you that everything works now! This is a huge time saver for our deployment workflow.
I just wanted to note that it is pretty hard to find any documentation about the releaser. The one in the release-ci repo seems outdated because there is no section about the release property or how to add assets to that release from previous stages.
The one in the release-ci repo seems outdated because there is no section about the release property or how to add assets to that release from previous stages.
What do you mean @muuvmuuv can you please point me to that?
That is because the release-cli is a tool of its own that does not depend on the release keyword inside the YAML. Rather the release keyword requires the release-cli under the hood.
Thank you, @jaime! Could you assist me a little more how I now use a previously generate artifact from e.g. a build job/step, so that I can link it properly in --assets-link:url? Is there any env var I could use to target Artifacts easier?
Let's say I have this artifact: <gitlab_url>/HEM/ci-test/-/jobs/2136/artifacts/raw/test.txt
How do I translate that into the release-ci workflow. I expect something similar like this:
Which is cool because it points to a build ref like from a version tag. Unfortunately opening the url from the release section results in 404, only after reloading the download starts which is weird.
Using the dotenv approach would make our .gitlab-ci huge because we have 5 assets ^^ and it wouldn't be easy to read.
release_job: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - job: publish_job artifacts: true rules: - if: $CI_COMMIT_TAG when: never # Do not run this job when a tag is created manually - if: $CI_COMMIT_BRANCH == 'stable' # Run this job when commits are pushed or merged to the default branch script: - echo 'Release Job for $TAG' release: name: 'Release $TAG' description: Release created for ${MAJOR}_${MINOR}_${REVISION} tag_name: v${MAJOR}_${MINOR}_${REVISION}
@samir_patel3456 can you confirm your GitLab version and that you are using a docker executor? Unfortunately, the release-cli is not automatically available for non-docker executors. Also the minimum required GitLab version is 13.2.
@samir_patel3456 can you please get the output of the following commands
(For installations with omnibus-gitlab package run and paste the output of:`sudo gitlab-rake gitlab:env:info`)(For installations from source run and paste the output of:`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
If you don't have access to the instance, can you navigate to your instance's help page, e.g.
https://gitlab.com/help and note the version at the top?
If the version under /help or from the command output is below 13.2 and if you have access to the Rails console, you could run the following command
Feature.enable(:ci_release_generation)
The feature flag :ci_release_generation was enabled by defualt in 13.2. By running the command above you are making sure that the feature is enabled.
Would you please post the full yaml which is issuing the error?
In this repo I took your example yaml and built out the rest of the instructions. It did validate, so perhaps there is a problem in one of the other nodes?
stages:-test-build-releasepublish_job:stage:buildscript:-echo 'build'echo_test:stage:testscript:-echo 'test'release_job:stage:releaseimage:registry.gitlab.com/gitlab-org/release-cli:latestneeds:-job:publish_jobartifacts:truerules:-if:$CI_COMMIT_TAGwhen:never# Do not run this job when a tag is created manually-if:$CI_COMMIT_BRANCH == 'stable'# Run this job when commits are pushed or merged to the default branchscript:-echo 'Release Job for $TAG'release:name:'Release$TAG'description:Release created for ${MAJOR}_${MINOR}_${REVISION}tag_name:v${MAJOR}_${MINOR}_${REVISION}