-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
stages: | ||
- build | ||
|
||
variables: | ||
BINARY_NAME: "pluto" | ||
|
||
build:linux-gnu-amd64: | ||
stage: build | ||
image: rust:latest | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
script: | ||
- 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 build --release | ||
- "mv target/release/$BINARY_NAME target/release/$BINARY_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG" | ||
- "mv target/release/$BINARY_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG public/" | ||
artifacts: | ||
paths: | ||
- "public/$BINARY_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG" | ||
|
||
build:linux-musl-amd64: | ||
stage: build | ||
image: rust:latest | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
script: | ||
- apt update | ||
- apt install -y musl-tools | ||
- rustup target add x86_64-unknown-linux-musl | ||
- cargo build --release --target x86_64-unknown-linux-musl | ||
- mkdir public | ||
- "mv target/x86_64-unknown-linux-musl/release/$BINARY_NAME target/x86_64-unknown-linux-musl/release/$BINARY_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG" | ||
- "mv target/x86_64-unknown-linux-musl/release/$BINARY_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG public/" | ||
artifacts: | ||
paths: | ||
- public/$BINARY_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG | ||
|
||
build:windows-amd64: | ||
stage: build | ||
image: rust:latest | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
script: | ||
- apt update | ||
- apt install -y g++-mingw-w64-x86-64 | ||
- rustup target add x86_64-pc-windows-gnu | ||
- rustup toolchain install stable-x86_64-pc-windows-gnu | ||
- cargo build --release --target x86_64-pc-windows-gnu | ||
- mkdir public | ||
- "mv target/x86_64-pc-windows-gnu/release/$BINARY_NAME.exe target/x86_64-pc-windows-gnu/release/$BINARY_NAME-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe" | ||
- "mv target/x86_64-pc-windows-gnu/release/$BINARY_NAME-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe public/" | ||
artifacts: | ||
paths: | ||
- public/$BINARY_NAME-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe | ||
|
||
rustdoc: | ||
stage: build | ||
image: rust | ||
rules: | ||
- if: $CI_COMMIT_TAG | ||
script: | ||
- cargo doc --no-deps | ||
artifacts: | ||
paths: | ||
- target/doc | ||
#release_job: | ||
# stage: release | ||
# image: registry.gitlab.com/gitlab-org/release-cli:latest | ||
# rules: | ||
# - if: $CI_COMMIT_TAG # Run this job when a tag is created | ||
# script: | ||
# - echo "running release_job" | ||
# release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties | ||
# tag_name: "$CI_COMMIT_TAG" | ||
# description: "$CI_COMMIT_TAG" | ||
# assets: | ||
# links: | ||
# - name: "$BINARY_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG" | ||
# url: "https://git.rua.plus/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/cw/-/jobs/${CI_JOB_ID}/artifacts/file/public/$BINARY_NAME-x86_64-unknown-linux-gnu-$CI_COMMIT_TAG" | ||
# - name: "$BINARY_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG" | ||
# url: "https://git.rua.plus/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/cw/-/jobs/${CI_JOB_ID}/artifacts/file/public/$BINARY_NAME-x86_64-unknown-linux-musl-$CI_COMMIT_TAG" | ||
# - name: "ua-list-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe" | ||
# url: "https://git.rua.plus/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/cw/-/jobs/${CI_JOB_ID}/artifacts/file/public/ua-list-x86_64-pc-windows-gnu-$CI_COMMIT_TAG.exe" |