From 5bc9246c0599f43b97395fed33b5891ba820a651 Mon Sep 17 00:00:00 2001 From: angie Date: Sat, 10 Jun 2023 10:20:16 -0400 Subject: [PATCH] Make Rust acknowledge the tables/ folder --- .github/workflows/publish_crate.yml | 4 ++++ Cargo.toml | 2 +- rust/build.rs | 6 +++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish_crate.yml b/.github/workflows/publish_crate.yml index 7e79547..94505eb 100644 --- a/.github/workflows/publish_crate.yml +++ b/.github/workflows/publish_crate.yml @@ -33,6 +33,10 @@ jobs: - name: Build Rust tests run: cargo test --workspace + - name: Publish dry run + if: github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/') + run: cargo publish --dry-run + - name: Upload crate if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index fef3f81..5de1a02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ repository = "https://github.com/Decompollaborate/rabbitizer" license = "MIT" keywords = ["MIPS", "decoder"] build = "rust/build.rs" -include = ["/rust/src", "/rust/build.rs", "/src", "/include"] +include = ["/rust/src", "/rust/build.rs", "/src", "/include", "/tables"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/rust/build.rs b/rust/build.rs index 00f26c5..826ac1f 100644 --- a/rust/build.rs +++ b/rust/build.rs @@ -7,8 +7,12 @@ fn main() { .unwrap() .filter_map(|g| g.ok()) .collect(); + let tables_paths: Vec = glob::glob("tables/tables/**/*.inc") + .unwrap() + .filter_map(|g| g.ok()) + .collect(); - for path in c_paths.iter().chain(&h_paths) { + for path in c_paths.iter().chain(&h_paths).chain(&tables_paths) { println!("cargo:rerun-if-changed={}", path.to_string_lossy()); }