From ae055be9cc28648a4eb49d48f948d7eb5f055b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Molin?= Date: Mon, 9 Nov 2026 12:45:41 +0100 Subject: [PATCH] Added gitea pipeline --- .gitea/workflows/windows.yml | 65 ++++++++++++++++++++++++++++++++++++ Cargo.lock | 8 ++--- crates/app/Cargo.toml | 4 ++- crates/app/build.rs | 1 - 4 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 .gitea/workflows/windows.yml diff --git a/.gitea/workflows/windows.yml b/.gitea/workflows/windows.yml new file mode 100644 index 0000000..a1a695a --- /dev/null +++ b/.gitea/workflows/windows.yml @@ -0,0 +1,65 @@ +# Cross-compiles reqlite for Windows (x86_64-pc-windows-gnu, MinGW-w64) on the +# standard Ubuntu runner and uploads a portable zip with both binaries. +name: windows + +on: + push: + branches: [main] + tags: ["v*"] + pull_request: + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + TARGET: x86_64-pc-windows-gnu + # Link the MinGW C runtime pieces statically so the .exe files need no DLLs. + CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS: -C target-feature=+crt-static + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install MinGW-w64 and zip + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 zip + + - name: Install Rust (version from rust-toolchain.toml) + run: | + if ! command -v rustup >/dev/null; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain none + echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" + export PATH="$HOME/.cargo/bin:$PATH" + fi + rustup show active-toolchain || rustup toolchain install + rustup target add "$TARGET" + + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: windows-gnu-${{ hashFiles('rust-toolchain.toml', 'Cargo.lock') }} + restore-keys: windows-gnu- + + - name: Build + run: cargo build --release --locked --target "$TARGET" -p reqlite-app -p reqlite-cli + + - name: Package + id: package + run: | + version=$(cargo pkgid -p reqlite-app | sed 's/.*[#@]//') + name="reqlite-${version}-windows-x86_64" + dir="target/dist/${name}" + rm -rf "$dir" && mkdir -p "$dir" + cp "target/$TARGET/release/reqlite-gui.exe" "target/$TARGET/release/reqlite.exe" README.md "$dir/" + (cd target/dist && rm -f "${name}.zip" && zip -r9 "${name}.zip" "$name") + echo "name=${name}" >> "$GITHUB_OUTPUT" + + - uses: actions/upload-artifact@v3 + with: + name: ${{ steps.package.outputs.name }} + path: target/dist/${{ steps.package.outputs.name }}.zip diff --git a/Cargo.lock b/Cargo.lock index eff237b..a2e1d04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3340,7 +3340,7 @@ checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "reqlite-app" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "base64 0.23.1", @@ -3368,7 +3368,7 @@ dependencies = [ [[package]] name = "reqlite-cli" -version = "0.1.0" +version = "0.2.0" dependencies = [ "anyhow", "clap", @@ -3382,7 +3382,7 @@ dependencies = [ [[package]] name = "reqlite-core" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-trait", "base64 0.23.1", @@ -3397,7 +3397,7 @@ dependencies = [ [[package]] name = "reqlite-http-curl" -version = "0.1.0" +version = "0.2.0" dependencies = [ "curl", "rcgen", diff --git a/crates/app/Cargo.toml b/crates/app/Cargo.toml index e9ca3d2..e17ec87 100644 --- a/crates/app/Cargo.toml +++ b/crates/app/Cargo.toml @@ -46,7 +46,9 @@ uuid.workspace = true egui_kittest.workspace = true tempfile.workspace = true -[target.'cfg(windows)'.build-dependencies] +# Unconditional so the icon is also embedded when cross-compiling from Linux +# (build.rs checks the *target* OS; only used for Windows targets). +[build-dependencies] winresource.workspace = true # `cargo bundle --release -p reqlite-app` builds a macOS .app (and .deb). diff --git a/crates/app/build.rs b/crates/app/build.rs index 611060a..1411b58 100644 --- a/crates/app/build.rs +++ b/crates/app/build.rs @@ -2,7 +2,6 @@ fn main() { println!("cargo:rerun-if-changed=assets/icon.ico"); - #[cfg(windows)] if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") { let mut res = winresource::WindowsResource::new(); res.set_icon("assets/icon.ico");