Update .gitlab-ci.yml file
This commit is contained in:
49
.gitlab-ci.yml
Normal file
49
.gitlab-ci.yml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- release
|
||||||
|
|
||||||
|
variables:
|
||||||
|
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
|
||||||
|
RUSTUP_HOME: "$CI_PROJECT_DIR/.rustup"
|
||||||
|
|
||||||
|
# 🏗 Build Linux
|
||||||
|
build-linux:
|
||||||
|
stage: build
|
||||||
|
image: rust:latest
|
||||||
|
script:
|
||||||
|
- rustup default stable
|
||||||
|
- cargo build --release
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- target/release/yourapp # Remplace "yourapp" par le nom de ton binaire
|
||||||
|
expire_in: 1 week
|
||||||
|
|
||||||
|
# 🏗 Build Windows
|
||||||
|
build-windows:
|
||||||
|
stage: build
|
||||||
|
image: rustembedded/cross:x86_64-pc-windows-gnu
|
||||||
|
script:
|
||||||
|
- cross build --release --target x86_64-pc-windows-gnu
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- target/x86_64-pc-windows-gnu/release/yourapp.exe
|
||||||
|
expire_in: 1 week
|
||||||
|
|
||||||
|
# 📦 Attach les builds à la release
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
image: curlimages/curl:latest
|
||||||
|
script:
|
||||||
|
- echo "Attaching builds to GitLab Release..."
|
||||||
|
release:
|
||||||
|
tag_name: "$CI_COMMIT_TAG"
|
||||||
|
name: "$CI_COMMIT_TAG"
|
||||||
|
description: "Release $CI_COMMIT_TAG"
|
||||||
|
assets:
|
||||||
|
links:
|
||||||
|
- name: "Linux Build"
|
||||||
|
url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/target/release/yourapp"
|
||||||
|
- name: "Windows Build"
|
||||||
|
url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/target/x86_64-pc-windows-gnu/release/yourapp.exe"
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
Reference in New Issue
Block a user