From 2d73307d3af134aa40bf4261d0b4e30302ee0500 Mon Sep 17 00:00:00 2001 From: dukantic Date: Tue, 8 Jul 2025 21:29:21 +0000 Subject: [PATCH] Update .gitlab-ci.yml file --- .gitlab-ci.yml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f2a0786..445d059 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,34 +2,41 @@ 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 + - mkdir -p build/linux + - cp target/release/polymusic build/linux/polymusic + - cp -r assets build/linux/assets + - cd build && zip -r linux-build.zip linux artifacts: paths: - - target/release/yourapp # Remplace "yourapp" par le nom de ton binaire + - build/linux + - build/linux-build.zip expire_in: 1 week -# 🏗 Build Windows build-windows: stage: build - image: rustembedded/cross:x86_64-pc-windows-gnu + image: rust:latest + before_script: + - apt update && apt install -y mingw-w64 zip script: - - cross build --release --target x86_64-pc-windows-gnu + - rustup default stable + - rustup target add x86_64-pc-windows-gnu + - cargo build --release --target x86_64-pc-windows-gnu + - mkdir -p build/windows + - cp target/x86_64-pc-windows-gnu/release/polymusic.exe build/windows/polymusic.exe + - cp -r assets build/windows/assets + - cd build && zip -r windows-build.zip windows artifacts: paths: - - target/x86_64-pc-windows-gnu/release/yourapp.exe + - build/windows + - build/windows-build.zip expire_in: 1 week -# 📦 Attach les builds à la release release: stage: release image: curlimages/curl:latest @@ -41,9 +48,9 @@ release: 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" + - name: "Linux Build (.zip)" + url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/build/linux-build.zip" + - name: "Windows Build (.zip)" + url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/build/windows-build.zip" only: - tags