Skip to content
Snippets Groups Projects
Commit c788b187 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

WIP improve CI

parent 0a821554
No related branches found
No related tags found
No related merge requests found
Pipeline #32686 failed
...@@ -3,10 +3,16 @@ ...@@ -3,10 +3,16 @@
image: "rust:latest" image: "rust:latest"
stages: stages:
- build - build_stage
- upload_stage
- release_stage
build: # build gcli binary
build_stage:
stage: build stage: build
# only build gcli when adding a tag
only:
- tags
# image used for this build # image used for this build
image: rust image: rust
# build script # build script
...@@ -23,6 +29,33 @@ build: ...@@ -23,6 +29,33 @@ build:
- Cargo.lock - Cargo.lock
paths: paths:
- target/release - target/release
# only build gcli when adding a tag
# upload gcli binary to gitlab
upload_stage:
stage: upload
only: only:
- tags - tags
\ No newline at end of file image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file target/release/gcli "${PACKAGE_REGISTRY_URL}/gcli"
# create a gitlab release pointing to this binary
release_stage:
stage: release
only:
- tags
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Running the release job."
release:
tag_name: $CI_COMMIT_TAG
name: 'Release $CI_COMMIT_TAG'
description: 'Automated release for $CI_COMMIT_TAG'
assets:
links:
- name: 'gcli'
link_type: binary
url: "${PACKAGE_REGISTRY_URL}/gcli"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment