Prepare efo 0.1.0 cross-platform binary release
Rust CI Epoch Forge passed all CI checks.
Gitea/epoch_forge/pipeline/head This commit looks good Details

This commit is contained in:
Dandaedre 2026-09-13 20:15:24 +02:00
parent 13eb69cd2b
commit e9cf45ca7a
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
6 changed files with 50 additions and 31 deletions

5
.gitignore vendored
View File

@ -4,9 +4,8 @@
debug/
target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# This workspace ships a CLI, so Cargo.lock is tracked.
/dist/
# These are backup files generated by rustfmt
**/*.rs.bk

10
Cross.toml Normal file
View File

@ -0,0 +1,10 @@
# cross 0.2.5 release images are too old for current Rust build scripts.
# Use the newer images tested with the release target matrix.
[target.x86_64-unknown-linux-musl]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:main"
[target.aarch64-unknown-linux-musl]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:main"
[target.x86_64-pc-windows-gnu]
image = "ghcr.io/cross-rs/x86_64-pc-windows-gnu:main"

View File

@ -15,11 +15,11 @@
```bash
# Clone the repository
git clone https://github.com/yourname/epoch_forge.git
git clone https://proxy.dandaedre.com/gitea/idle-org/epoch_forge.git
cd epoch_forge
# Build & install the binary
cargo install --path .
cargo install --locked --path bin_efo
# Initialise an empty world (epoch 0)
efo init
@ -113,3 +113,26 @@ Please remember that **stability is not guaranteed**, so use it in a versionned
Happy forging! ✨
## Binary releases
The CLI package is `efo`, in the `bin_efo` workspace member. Release tags follow
its Cargo version (for example, `v0.1.0`). The publisher is invoked from its own
checkout with:
```bash
./release.sh /path/to/epoch_forge --package efo --tag v0.1.0
```
The workspace lockfile is tracked. `Cross.toml` selects the tested cross images
for x86-64 musl Linux, AArch64 musl Linux, and x86-64 GNU Windows. The build scripts
work with rustc alone inside cross containers; rustup is not required there.
Release archives use `efo-{target}-v{version}.tgz` and contain the matching root
directory with `efo` (or `efo.exe`). `SHA256SUMS` accompanies the archives. The
selected package manifest carries cargo-binstall metadata for the Gitea URLs.
After the matching release has been published, install from the local manifest:
```bash
cargo binstall efo --manifest-path bin_efo/Cargo.toml
```

View File

@ -2,7 +2,12 @@
name = "efo"
version = "0.1.0"
edition = "2024"
repository = "https://proxy.dandaedre.com/gitea/idle-org/epoch_forge"
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.tgz"
pkg-fmt = "tgz"
bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"
[dependencies]
lib_efo = { path = "../lib_efo" }
serde = {workspace = true}

View File

@ -28,22 +28,13 @@ fn main() {
let git_branch = run_cmd(Command::new("git").args(args));
println!("cargo:rustc-env=GIT_BRANCH={}", git_branch);
// Prefer the explicit env var – it mirrors the real user choice
// cross images contain rustc but need not contain the rustup manager.
let rustc_version = run_cmd(Command::new("rustc").args(["--version"]));
let toolchain = std::env::var("RUSTUP_TOOLCHAIN")
.map(|v| v.trim().to_owned())
.unwrap_or_else(|_| {
// Try rustup first; if that fails, fall back to rustc
let raw = run_cmd(Command::new("rustup").args(["show", "active-toolchain"]));
// rustup output may look like:
// stable-x86_64-unknown-linux-gnu (overridden by environment variable)
// We only want the part before the first '('
raw.split('(').next().unwrap().trim().to_owned()
});
.map(|value| value.trim().to_owned())
.unwrap_or_else(|_| rustc_version.clone());
println!("cargo:rustc-env=TOOLCHAIN={}", toolchain);
let rustc_version = run_cmd(Command::new("rustc").args(["--version"]));
println!("cargo:rustc-env=RUSTC_VERSION={}", rustc_version);
println!(
"cargo:rustc-env=EFO_SHORT_VERSION={} ({}{})",

View File

@ -28,22 +28,13 @@ fn main() {
let git_branch = run_cmd(Command::new("git").args(args));
println!("cargo:rustc-env=GIT_BRANCH={}", git_branch);
// Prefer the explicit env var – it mirrors the real user choice
// cross images contain rustc but need not contain the rustup manager.
let rustc_version = run_cmd(Command::new("rustc").args(["--version"]));
let toolchain = std::env::var("RUSTUP_TOOLCHAIN")
.map(|v| v.trim().to_owned())
.unwrap_or_else(|_| {
// Try rustup first; if that fails, fall back to rustc
let raw = run_cmd(Command::new("rustup").args(["show", "active-toolchain"]));
// rustup output may look like:
// stable-x86_64-unknown-linux-gnu (overridden by environment variable)
// We only want the part before the first '('
raw.split('(').next().unwrap().trim().to_owned()
});
.map(|value| value.trim().to_owned())
.unwrap_or_else(|_| rustc_version.clone());
println!("cargo:rustc-env=TOOLCHAIN={}", toolchain);
let rustc_version = run_cmd(Command::new("rustc").args(["--version"]));
println!("cargo:rustc-env=RUSTC_VERSION={}", rustc_version);
println!(
"cargo:rustc-env=EFO_SHORT_VERSION={} ({}{})",