From 570bf370768ce84afa05c9dd6970076e922be3bd Mon Sep 17 00:00:00 2001 From: Azalea Date: Wed, 23 Sep 2026 01:28:08 +0000 Subject: [PATCH] [F] Packaging - Bundle data assets and neofetch script into crate archive (#544) --- .github/workflows/release.yml | 8 +++++++- .gitignore | 4 ++++ crates/hyfetch/Cargo.toml | 8 ++++++++ crates/hyfetch/build.rs | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9d81b92..5ab087bb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -417,6 +417,12 @@ jobs: - uses: dtolnay/rust-toolchain@stable + - name: Prepare assets for crate packaging + run: | + mkdir -p crates/hyfetch/hyfetch + cp -r hyfetch/data crates/hyfetch/hyfetch/ + cp neofetch crates/hyfetch/ + - name: Authenticate with crates.io uses: rust-lang/crates-io-auth-action@v1 id: auth @@ -424,4 +430,4 @@ jobs: - name: Publish crate env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} - run: cargo publish -p hyfetch + run: cargo publish -p hyfetch --allow-dirty diff --git a/.gitignore b/.gitignore index b58ce3d4..609493e6 100644 --- a/.gitignore +++ b/.gitignore @@ -132,3 +132,7 @@ __pycache__ *.pyc *.pyo *.pyd + +# Cargo packaging temporary assets +crates/hyfetch/hyfetch +crates/hyfetch/neofetch diff --git a/crates/hyfetch/Cargo.toml b/crates/hyfetch/Cargo.toml index ff2e585b..0b2a28ad 100644 --- a/crates/hyfetch/Cargo.toml +++ b/crates/hyfetch/Cargo.toml @@ -9,6 +9,14 @@ repository = { workspace = true } license = { workspace = true } readme = { workspace = true } default-run = "hyfetch" +include = [ + "src/**/*", + "build.rs", + "Cargo.toml", + "README.md", + "hyfetch/**/*", + "neofetch", +] [dependencies] aho-corasick = { workspace = true, features = ["perf-literal", "std"] } diff --git a/crates/hyfetch/build.rs b/crates/hyfetch/build.rs index 5ce00d42..20976ce2 100644 --- a/crates/hyfetch/build.rs +++ b/crates/hyfetch/build.rs @@ -51,6 +51,7 @@ fn main() -> Result<()> { let data_dir = anything_that_exist(&[ &dir.join("hyfetch/data"), &dir.join("../../hyfetch/data"), + &dir.join("data"), ]).context("couldn't find hyfetch/data")?; let dst_root = o.join("hyfetch");