Skip to content

Commit

Permalink
Add env variable to release.yml workflow && rerun build on env change
Browse files Browse the repository at this point in the history
  • Loading branch information
yaziciahmet committed Dec 20, 2024
1 parent 5eb7228 commit 82fff65
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:

- name: Build Project
env:
REPR_GUEST_BUILD: 1
# TODO: make this dynamic somehow
CITREA_NETWORK: testnet
run: |
cargo build --release
Expand Down
5 changes: 5 additions & 0 deletions guests/risc0/batch-proof/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ use std::collections::HashMap;
use risc0_build::{embed_methods_with_options, DockerOptions, GuestOptions};

fn main() {
// Build environment variables
println!("cargo:rerun-if-env-changed=SKIP_GUEST_BUILD");
println!("cargo:rerun-if-env-changed=REPR_GUEST_BUILD");
println!("cargo:rerun-if-env-changed=OUT_DIR");
// Compile time constant environment variables
println!("cargo:rerun-if-env-changed=CITREA_NETWORK");
println!("cargo:rerun-if-env-changed=SEQUENCER_PUBLIC_KEY");
println!("cargo:rerun-if-env-changed=SEQUENCER_DA_PUB_KEY");

match std::env::var("SKIP_GUEST_BUILD") {
Ok(value) => match value.as_str() {
Expand Down
6 changes: 6 additions & 0 deletions guests/risc0/light-client-proof/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ use std::collections::HashMap;
use risc0_build::{embed_methods_with_options, DockerOptions, GuestOptions};

fn main() {
// Build environment variables
println!("cargo:rerun-if-env-changed=SKIP_GUEST_BUILD");
println!("cargo:rerun-if-env-changed=REPR_GUEST_BUILD");
println!("cargo:rerun-if-env-changed=OUT_DIR");
// Compile time constant environment variables
println!("cargo:rerun-if-env-changed=CITREA_NETWORK");
println!("cargo:rerun-if-env-changed=L2_GENESIS_ROOT");
println!("cargo:rerun-if-env-changed=BATCH_PROOF_METHOD_ID");
println!("cargo:rerun-if-env-changed=PROVER_DA_PUB_KEY");

match std::env::var("SKIP_GUEST_BUILD") {
Ok(value) => match value.as_str() {
Expand Down

0 comments on commit 82fff65

Please sign in to comment.