From a56f5ddba442f56d5ebea832acdaa5b6885698b3 Mon Sep 17 00:00:00 2001 From: dukantic Date: Tue, 8 Jul 2025 21:15:57 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f2a0786 --- /dev/null +++ b/.gitlab-ci.yml @@ -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