stages: - test - build - publish variables: RUSTUP_TOOLCHAIN: stable test: stage: test image: rust:latest script: - cargo test build_linux: stage: build image: rust:latest parallel: matrix: - TARGET: x86_64-unknown-linux-gnu BINARY_NAME: zenyx-x86_64-linux EXT: "" RUSTFLAGS: "" - TARGET: aarch64-unknown-linux-gnu BINARY_NAME: zenyx-aarch64-linux EXT: "" RUSTFLAGS: "-Clinker=aarch64-linux-gnu-gcc" - TARGET: powerpc64le-unknown-linux-gnu BINARY_NAME: zenyx-powerpc64le-linux EXT: "" RUSTFLAGS: "-Clinker=powerpc64le-linux-gnu-gcc" - TARGET: s390x-unknown-linux-gnu BINARY_NAME: zenyx-s390x-linux EXT: "" RUSTFLAGS: "-Clinker=s390x-linux-gnu-gcc" - TARGET: riscv64gc-unknown-linux-gnu BINARY_NAME: zenyx-riscv64-linux EXT: "" RUSTFLAGS: "-Clinker=riscv64-linux-gnu-gcc" cache: key: "${CI_JOB_NAME}-${CI_COMMIT_SHA}" policy: pull-push paths: - "$HOME/.cargo/registry" - "$HOME/.cargo/git" - target before_script: - apt-get update - | apt-get install -y \ build-essential \ gcc-aarch64-linux-gnu \ gcc-powerpc64le-linux-gnu \ gcc-s390x-linux-gnu \ gcc-riscv64-linux-gnu - rustup target add "$TARGET" script: - cargo build --release --target "$TARGET" - mkdir -p artifacts - cp "target/$TARGET/release/zenyx$EXT" "artifacts/$BINARY_NAME" artifacts: paths: - artifacts/* expire_in: 1 week build_windows_msvc: stage: build image: rust:latest variables: TARGET: x86_64-pc-windows-msvc BINARY_NAME: zenyx-x86_64-windows-msvc.exe EXT: ".exe" cache: key: "${CI_JOB_NAME}-${CI_COMMIT_SHA}" policy: pull-push paths: - "$HOME/.cargo/registry" - "$HOME/.cargo/git" - target - .cache/cargo-xwin before_script: - apt-get update - apt-get install -y lld - rustup target add "$TARGET" - cargo install cargo-xwin --locked - cargo xwin build --release --target "$TARGET" script: - mkdir -p artifacts - cp "target/$TARGET/release/zenyx$EXT" "artifacts/$BINARY_NAME" artifacts: paths: - artifacts/* expire_in: 1 week publish: stage: publish script: - echo "Publishing artifacts..." dependencies: - build_linux - build_windows_msvc