Hello all!
I want to automatically release binary of my app whenever I make a tagged commit. This is what I tried:
stages:
- build
- release
build:
stage: build
image: rust:latest
script:
- cargo build --release
- mv target/release/quack target/release/quack-$CI_COMMIT_TAG
- echo "$CI_JOB_ID" > CI_JOB_ID.txt
cache:
paths:
- target/release/
artifacts:
paths:
- target/release/quack-$CI_COMMIT_TAG
- CI_JOB_ID.txt
rules:
- if: $CI_COMMIT_TAG
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- echo 'Running release'
release:
name: 'quack-$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
tag_name: $CI_COMMIT_TAG
assets:
links:
- name: 'quack-$CI_COMMIT_TAG'
- url: 'https://gitlab.com/J-Arun-Mani/quack/-/jobs/`cat CI_JOB_ID.txt`/artifacts/browse/target/release/'
Whenever I make tagged commit, the build
job passes successfully but the release
job fails with the follow error:
API Error Response status_code: 400 message: Validation failed: Links url can't be blank, Links url must be a valid URL, Links name can't be blank" version=0.9.0
So I kindly require help here. What am I doing wrong? Is the way I make the releases good or can it be improved?
Thanks for reading!