mirror of
https://github.com/DefectingCat/candy
synced 2025-07-15 08:41:35 +00:00
101 lines
3.3 KiB
YAML
101 lines
3.3 KiB
YAML
stages:
|
|
- test
|
|
- build
|
|
|
|
variables:
|
|
APP_NAME: "candy"
|
|
# GIT_CLONE_PATH: "$CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID"
|
|
# use for much faster builds
|
|
DOCKER_DRIVER: overlay2
|
|
# ensure cross knows it's running remotely
|
|
CROSS_REMOTE: 1
|
|
|
|
image: "rust:latest"
|
|
|
|
before_script:
|
|
- apt-get update -y
|
|
- apt-get install -y docker.io
|
|
- mkdir $HOME/.cargo
|
|
- echo "[source.crates-io]" >> $HOME/.cargo/config
|
|
- echo "replace-with = 'ustc'" >> $HOME/.cargo/config
|
|
- echo "" >> $HOME/.cargo/config
|
|
- echo "[source.ustc]" >> $HOME/.cargo/config
|
|
- echo "registry = \"sparse+https://mirrors.ustc.edu.cn/crates.io-index/\"" >> $HOME/.cargo/config
|
|
- mkdir public
|
|
- cargo install cross --git https://github.com/cross-rs/cross
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- cargo test
|
|
|
|
build:freebsd:
|
|
stage: build
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- make build-freebsd
|
|
- "mv target/x86_64-unknown-freebsd/release/$APP_NAME target/x86_64-unknown-freebsd/release/$APP_NAME-x86_64-unknown-freebsd-$CI_COMMIT_TAG"
|
|
- "mv target/x86_64-unknown-freebsd/release/$APP_NAME-x86_64-unknown-freebsd-$CI_COMMIT_TAG public/"
|
|
artifacts:
|
|
paths:
|
|
- "public/$APP_NAME-x86_64-unknown-freebsd-$CI_COMMIT_TAG"
|
|
|
|
build:linux-gnu-amd64:
|
|
stage: build
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- cargo build --release
|
|
- "mv target/release/$APP_NAME target/release/$APP_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG"
|
|
- "mv target/release/$APP_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG public/"
|
|
artifacts:
|
|
paths:
|
|
- "public/$APP_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG"
|
|
|
|
build:linux-musl-amd64:
|
|
stage: build
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- make build-linux-musl
|
|
- "mv target/x86_64-unknown-linux-musl/release/$APP_NAME target/x86_64-unknown-linux-musl/release/$APP_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG"
|
|
- "mv target/x86_64-unknown-linux-musl/release/$APP_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG public/"
|
|
artifacts:
|
|
paths:
|
|
- public/$APP_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG
|
|
|
|
build:windows-amd64:
|
|
stage: build
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- make build-windows-gnu
|
|
- "mv target/x86_64-pc-windows-gnu/release/$APP_NAME.exe target/x86_64-pc-windows-gnu/release/$APP_NAME-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe"
|
|
- "mv target/x86_64-pc-windows-gnu/release/$APP_NAME-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe public/"
|
|
artifacts:
|
|
paths:
|
|
- public/$APP_NAME-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe
|
|
|
|
build:linux-loongarch:
|
|
stage: build
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- make build-loongarch
|
|
- "mv target/loongarch64-unknown-linux-gnu/release/$APP_NAME target/loongarch64-unknown-linux-gnu/release/$APP_NAME-loongarch64-unknown-linux-gnu-$CI_COMMIT_TAG"
|
|
- "mv target/loongarch64-unknown-linux-gnu/release/$APP_NAME-loongarch64-unknown-linux-gnu-$CI_COMMIT_TAG public/"
|
|
artifacts:
|
|
paths:
|
|
- public/$APP_NAME-loongarch64-unknown-linux-gnu-$CI_COMMIT_TAG
|
|
|
|
rustdoc:
|
|
stage: build
|
|
rules:
|
|
- if: $CI_COMMIT_TAG
|
|
script:
|
|
- cargo doc --no-deps
|
|
artifacts:
|
|
paths:
|
|
- target/doc
|