|
| 1 | +variables: |
| 2 | + IMAGE_RUST: "rust" |
| 3 | + IMAGE_RUST_XWIN: "messense/cargo-xwin" |
| 4 | + IMAGE_RUST_ZIGBUILD: "ghcr.io/rust-cross/cargo-zigbuild" |
| 5 | + PATH_CONFIG: "server/config.toml" |
| 6 | + TARGET_WINDOWS: "x86_64-pc-windows-msvc" |
| 7 | + TARGET_LINUX: "x86_64-unknown-linux-musl" |
| 8 | + TARGET_MACOS_ARM: "aarch64-apple-darwin" |
| 9 | + TARGET_MACOS_INTEL: "x86_64-apple-darwin" |
| 10 | + |
| 11 | +stages: |
| 12 | + - build |
| 13 | + |
| 14 | +build.linux: |
| 15 | + stage: build |
| 16 | + image: "${IMAGE_RUST_ZIGBUILD}" |
| 17 | + script: |
| 18 | + - "rustup target add ${TARGET_LINUX}" |
| 19 | + - "cargo zigbuild --release --target ${TARGET_LINUX}" |
| 20 | + artifacts: |
| 21 | + when: on_success |
| 22 | + access: all |
| 23 | + expire_in: "30 days" |
| 24 | + paths: |
| 25 | + - "target/${TARGET_LINUX}/release/proxy" |
| 26 | + - "${PATH_CONFIG}" |
| 27 | + name: "${TARGET_LINUX}" |
| 28 | + |
| 29 | +build.windows: |
| 30 | + stage: build |
| 31 | + image: "${IMAGE_RUST_XWIN}" |
| 32 | + script: |
| 33 | + - "rustup target add ${TARGET_WINDOWS}" |
| 34 | + - "cargo xwin build --release --target ${TARGET_WINDOWS}" |
| 35 | + artifacts: |
| 36 | + when: on_success |
| 37 | + access: all |
| 38 | + expire_in: "30 days" |
| 39 | + paths: |
| 40 | + - "target/${TARGET_WINDOWS}/release/proxy.exe" |
| 41 | + - "${PATH_CONFIG}" |
| 42 | + name: "${TARGET_WINDOWS}" |
| 43 | + |
| 44 | +build.macos.arm: |
| 45 | + stage: build |
| 46 | + image: "${IMAGE_RUST_ZIGBUILD}" |
| 47 | + script: |
| 48 | + - "rustup target add ${TARGET_MACOS_ARM}" |
| 49 | + - "cargo zigbuild --release --target ${TARGET_MACOS_ARM}" |
| 50 | + artifacts: |
| 51 | + when: on_success |
| 52 | + access: all |
| 53 | + expire_in: "30 days" |
| 54 | + paths: |
| 55 | + - "target/${TARGET_MACOS_ARM}/release/proxy" |
| 56 | + - "${PATH_CONFIG}" |
| 57 | + name: "${TARGET_MACOS_ARM}" |
| 58 | + |
| 59 | +build.macos.intel: |
| 60 | + stage: build |
| 61 | + image: "${IMAGE_RUST_ZIGBUILD}" |
| 62 | + script: |
| 63 | + - "rustup target add ${TARGET_MACOS_INTEL}" |
| 64 | + - "cargo zigbuild --release --target ${TARGET_MACOS_INTEL}" |
| 65 | + artifacts: |
| 66 | + when: on_success |
| 67 | + access: all |
| 68 | + expire_in: "30 days" |
| 69 | + paths: |
| 70 | + - "target/${TARGET_MACOS_INTEL}/release/proxy" |
| 71 | + - "${PATH_CONFIG}" |
| 72 | + name: "${TARGET_MACOS_INTEL}" |
| 73 | + |
| 74 | +.build.native: |
| 75 | + stage: build |
| 76 | + image: "${IMAGE_RUST}" |
| 77 | + script: |
| 78 | + - "cargo build --release" |
| 79 | + artifacts: |
| 80 | + when: on_success |
| 81 | + access: all |
| 82 | + expire_in: "30 days" |
| 83 | + paths: |
| 84 | + - "target/release/proxy" |
| 85 | + - "${PATH_CONFIG}" |
0 commit comments