Update .gitlab-ci.yml file
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user