[F] Packaging - Bundle data assets and neofetch script into crate archive (#544)

This commit is contained in:
Azalea
2026-09-23 01:28:08 +00:00
parent a0f9e562e7
commit 570bf37076
4 changed files with 20 additions and 1 deletions

View File

@@ -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

4
.gitignore vendored
View File

@@ -132,3 +132,7 @@ __pycache__
*.pyc
*.pyo
*.pyd
# Cargo packaging temporary assets
crates/hyfetch/hyfetch
crates/hyfetch/neofetch

View File

@@ -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"] }

View File

@@ -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");