Update .gitlab-ci.yml file
This commit is contained in:
@@ -2,34 +2,41 @@ stages:
|
|||||||
- build
|
- build
|
||||||
- release
|
- release
|
||||||
|
|
||||||
variables:
|
|
||||||
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
|
|
||||||
RUSTUP_HOME: "$CI_PROJECT_DIR/.rustup"
|
|
||||||
|
|
||||||
# 🏗 Build Linux
|
|
||||||
build-linux:
|
build-linux:
|
||||||
stage: build
|
stage: build
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
script:
|
script:
|
||||||
- rustup default stable
|
- rustup default stable
|
||||||
- cargo build --release
|
- 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:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- target/release/yourapp # Remplace "yourapp" par le nom de ton binaire
|
- build/linux
|
||||||
|
- build/linux-build.zip
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
# 🏗 Build Windows
|
|
||||||
build-windows:
|
build-windows:
|
||||||
stage: build
|
stage: build
|
||||||
image: rustembedded/cross:x86_64-pc-windows-gnu
|
image: rust:latest
|
||||||
|
before_script:
|
||||||
|
- apt update && apt install -y mingw-w64 zip
|
||||||
script:
|
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:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- target/x86_64-pc-windows-gnu/release/yourapp.exe
|
- build/windows
|
||||||
|
- build/windows-build.zip
|
||||||
expire_in: 1 week
|
expire_in: 1 week
|
||||||
|
|
||||||
# 📦 Attach les builds à la release
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
image: curlimages/curl:latest
|
image: curlimages/curl:latest
|
||||||
@@ -41,9 +48,9 @@ release:
|
|||||||
description: "Release $CI_COMMIT_TAG"
|
description: "Release $CI_COMMIT_TAG"
|
||||||
assets:
|
assets:
|
||||||
links:
|
links:
|
||||||
- name: "Linux Build"
|
- name: "Linux Build (.zip)"
|
||||||
url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/target/release/yourapp"
|
url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/build/linux-build.zip"
|
||||||
- name: "Windows Build"
|
- name: "Windows Build (.zip)"
|
||||||
url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/target/x86_64-pc-windows-gnu/release/yourapp.exe"
|
url: "$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/build/windows-build.zip"
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
|
|||||||
Reference in New Issue
Block a user