Files
Polymusic/.gitlab-ci.yml
2025-07-08 21:15:57 +00:00

50 lines
1.2 KiB
YAML

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