1 parent
1eec55181d
commit
ae055be9cc
4 files changed
+72
-6
No files matched your search
@@ -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
|
||||
Generated
+4
-4
@@ -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",
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in new issue
Block a user