diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3ea09606..581751e6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -193,6 +193,8 @@ jobs: if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest needs: [ release ] + env: + DOCKER_BUILD: true steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable diff --git a/lib/build.rs b/lib/build.rs index 627317ea..aa473e45 100644 --- a/lib/build.rs +++ b/lib/build.rs @@ -1,9 +1,8 @@ fn main() -> Result<(), Box> { // otherwise fails while building Docker image - #[cfg(not(target_env = "musl"))] - { - for proto in std::fs::read_dir("tests/grpc/protos").unwrap() { - proto.map(|p| p.path()).ok().map(tonic_build::compile_protos).transpose()?; + if std::env::var("DOCKER_BUILD").is_err() { + for proto in std::fs::read_dir("tests/grpc/protos")? { + tonic_build::compile_protos(proto?.path())?; } } Ok(())