Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Verified Commit 5d1e7d23 authored by Ayush Singh's avatar Ayush Singh
Browse files

CI: Use cargo-dist


- Building all executables using cargo-dist
- Still using cargo-appimage for appimage building. Will switch to
  cargo-dist once support is merged upstream
- Download appimagetool from github ci
- Build windows-gnu from the same job since I am cross compiling anyway.

Signed-off-by: Ayush Singh's avatarAyush Singh <ayush@beagleboard.org>
parent 854182eb
1 merge request!9CI: Use cargo-dist
Pipeline #18166 passed with stages
in 4 minutes and 52 seconds
......@@ -14,39 +14,29 @@ test:
- rustc --version && cargo --version # Print version info for debugging
- cargo test --workspace --verbose
appimage:
# Build all possible images in Linux host
linux_host:
image: "rust:latest"
tags:
- docker-amd64
stage: build
before_script:
- apt-get update && apt-get install -y --no-install-recommends file wget libudev-dev gcc-mingw-w64
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.20.0/cargo-dist-installer.sh | sh
- cargo install cargo-appimage
- apt-get update && apt-get install -y --no-install-recommends file wget libudev-dev
- wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage -O /usr/local/bin/appimagetool
- wget https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$(uname -m).AppImage -O /usr/local/bin/appimagetool
- chmod +x /usr/local/bin/appimagetool
- sed -i 's|AI\x02|\x00\x00\x00|' /usr/local/bin/appimagetool
- rustup target add x86_64-pc-windows-gnu
script:
- cargo dist build --target x86_64-pc-windows-gnu --target x86_64-unknown-linux-gnu
- cd gui
- APPIMAGE_EXTRACT_AND_RUN=1 cargo appimage
artifacts:
paths:
- target/distrib/*.tar.*
- target/appimage/gui.AppImage
windows:
image: "rust:latest"
tags:
- docker-amd64
stage: build
before_script:
- apt-get update && apt-get install -y --no-install-recommends gcc-mingw-w64
- rustup target add x86_64-pc-windows-gnu
script:
- cargo build --package gui --target x86_64-pc-windows-gnu --release
- cargo build --package cli --target x86_64-pc-windows-gnu --release
artifacts:
paths:
- target/x86_64-pc-windows-gnu/release/*.exe
macos:
image: macos-14-xcode-15
stage: build
......@@ -55,11 +45,10 @@ macos:
before_script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- source "$HOME/.cargo/env"
- curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.20.0/cargo-dist-installer.sh | sh
script:
- rustc --version
- cargo build --package gui --target aarch64-apple-darwin --release
- cargo build --package cli --target aarch64-apple-darwin --release
- cargo dist build --target aarch64-apple-darwin
artifacts:
paths:
- target/aarch64-apple-darwin/release/gui
- target/aarch64-apple-darwin/release/cli
- target/distrib/*.tar.*
......@@ -6,5 +6,19 @@ members = [
"cli", "gui",
]
# Config for 'cargo dist'
[workspace.metadata.dist]
# The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax)
cargo-dist-version = "0.20.0"
# The installers to generate for each app
installers = []
# Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-gnu"]
[profile.release]
strip = true
# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment