Skip to content

Commit 39d823b

Browse files
authored
Merge pull request #23 from Navigraph/build-info
Add build info to sentry report
2 parents abd627c + 926a1f4 commit 39d823b

File tree

7 files changed

+178
-3
lines changed

7 files changed

+178
-3
lines changed

.github/workflows/pre-release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
with:
17+
filter: blob:none
1618

1719
- name: Create env file
1820
run: |

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17+
with:
18+
filter: blob:none
1719

1820
- name: Create env file
1921
run: |

Cargo.lock

Lines changed: 146 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM rust:1.84.1
22

33
# Install needed packages and clean up
44
RUN apt update && \
5-
apt install -y --no-install-recommends lsb-release wget software-properties-common gnupg gcc-multilib && \
5+
apt install -y --no-install-recommends lsb-release wget software-properties-common gnupg gcc-multilib git && \
66
rm -rf /var/lib/apt/lists/*
77

88
# Install clang and clean up
@@ -25,3 +25,6 @@ ARG CACHEBUST
2525
# Install MSFS2020 and MSFS2024 SDK
2626
RUN cargo-msfs install msfs2020 && \
2727
cargo-msfs install msfs2024
28+
29+
# Needed when running in CI/CD to avoid dubious ownership errors
30+
RUN git config --global --add safe.directory /workspace

src/wasm/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ serde_rusqlite = "0.36.0"
2626
serde_with = "3.12.0"
2727
uuid = { version = "1.16.0", features = ["rng-rand", "v4"] }
2828
zip = { version = "2.5.0", default-features = false, features = ["deflate"] }
29+
30+
[build-dependencies]
31+
vergen-gitcl = { version = "1.0.8", features = ["build", "cargo"] }

src/wasm/build.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use vergen_gitcl::{BuildBuilder, CargoBuilder, Emitter, GitclBuilder};
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
let build = BuildBuilder::all_build()?;
5+
let cargo = CargoBuilder::all_cargo()?;
6+
let gitcl = GitclBuilder::all_git()?;
7+
8+
Emitter::default()
9+
.add_instructions(&build)?
10+
.add_instructions(&cargo)?
11+
.add_instructions(&gitcl)?
12+
.emit()?;
13+
14+
Ok(())
15+
}

src/wasm/src/sentry_gauge.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ where
260260
..Default::default()
261261
}));
262262

263+
// Build specific settings
264+
scope.set_tag("git_sha", env!("VERGEN_GIT_SHA"));
265+
scope.set_tag("git_dirty", env!("VERGEN_GIT_DIRTY"));
266+
scope.set_tag("built_at", env!("VERGEN_BUILD_TIMESTAMP"));
267+
268+
// Addon specific settings
263269
let config = Config::get_config();
264270
scope.set_tag(
265271
"developer",

0 commit comments

Comments
 (0)