Skip to content

Commit

Permalink
build: prevent Docker image build to fail due to missing 'protoc' on …
Browse files Browse the repository at this point in the history
…builder container
  • Loading branch information
beltram committed Jun 13, 2023
1 parent 7316527 commit 902df7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions lib/build.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
// 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(())
Expand Down

0 comments on commit 902df7a

Please sign in to comment.