Skip to content

Commit

Permalink
fix: release plz embeddings (#328)
Browse files Browse the repository at this point in the history
* fix: release plz embeddings

* lint
  • Loading branch information
clabby authored Jun 26, 2024
1 parent a32b6ad commit e7addf7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 18 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
release-plz:
name: Release-plz
name: Release-plz - ${{ matrix.dir }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -26,18 +26,6 @@ jobs:
fetch-depth: 0
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
# If releases break due to dirty `Cargo.lock` changes, toggle this step back on.
# If the cargo lock file changes due to upstream dependency versions updating,
# with semvers still matching, the workflow will have "uncommitted" changes
# which would prevent the release. This step commits any `Cargo.lock` changes
# so the release can proceed.
# - name: Commit Cargo.lock
# working-directory: ${{ matrix.dir }}
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git add Cargo.lock
# git commit -m "Update Cargo.lock" || echo "No changes to commit"
- name: Run release-plz
uses: MarcoIeni/[email protected]
with:
Expand Down
32 changes: 32 additions & 0 deletions bindings/rust-bindings/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
use std::env;
use std::path::PathBuf;

fn main() {
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is not set");

let superchain_configs = PathBuf::from(&manifest_dir).join("../../superchain/configs");
let superchain_extra = PathBuf::from(&manifest_dir).join("../../superchain/extra");
let superchain_implementations =
PathBuf::from(&manifest_dir).join("../../superchain/implementations");

println!("cargo:rerun-if-env-changed=CARGO_MANIFEST_DIR");
println!("cargo:rerun-if-changed={}", superchain_configs.display());
println!("cargo:rerun-if-changed={}", superchain_extra.display());
println!(
"cargo:rerun-if-changed={}",
superchain_implementations.display()
);

println!(
"cargo:rustc-env=SUPERCHAIN_CONFIGS={}",
superchain_configs.display()
);
println!(
"cargo:rustc-env=SUPERCHAIN_EXTRA={}",
superchain_extra.display()
);
println!(
"cargo:rustc-env=SUPERCHAIN_IMPLEMENTATIONS={}",
superchain_implementations.display()
);
}
8 changes: 3 additions & 5 deletions bindings/rust-bindings/src/embed.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
use include_dir::{include_dir, Dir};

/// Directory containing the configuration files for the superchain.
pub(crate) static CONFIGS_DIR: Dir<'_> =
include_dir!("$CARGO_MANIFEST_DIR/../../superchain/configs");
pub(crate) static CONFIGS_DIR: Dir<'_> = include_dir!("$SUPERCHAIN_CONFIGS");

/// Directory containing the extra files for the superchain.
pub(crate) static EXTRA_DIR: Dir<'_> = include_dir!("$CARGO_MANIFEST_DIR/../../superchain/extra");
pub(crate) static EXTRA_DIR: Dir<'_> = include_dir!("$SUPERCHAIN_EXTRA");

/// Directory containing the implementation addresses for the superchain.
pub(crate) static IMPLEMENTATIONS_DIR: Dir<'_> =
include_dir!("$CARGO_MANIFEST_DIR/../../superchain/implementations");
pub(crate) static IMPLEMENTATIONS_DIR: Dir<'_> = include_dir!("$SUPERCHAIN_IMPLEMENTATIONS");

0 comments on commit e7addf7

Please sign in to comment.