mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 22:53:28 +00:00
Make the the short git SHA available within the program
This commit is contained in:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
- uses: ./.github/actions/install
|
- uses: ./.github/actions/install
|
||||||
|
|
||||||
- name: zig build
|
- name: zig build
|
||||||
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dcpu=x86_64
|
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
|
||||||
|
|
||||||
- name: Rename binary
|
- name: Rename binary
|
||||||
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
|
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
arch: ${{env.ARCH}}
|
arch: ${{env.ARCH}}
|
||||||
|
|
||||||
- name: zig build
|
- name: zig build
|
||||||
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8
|
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
|
||||||
|
|
||||||
- name: Rename binary
|
- name: Rename binary
|
||||||
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
|
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
|
||||||
|
|||||||
@@ -58,6 +58,15 @@ pub fn build(b: *std.Build) !void {
|
|||||||
.optimize = mode,
|
.optimize = mode,
|
||||||
});
|
});
|
||||||
try common(b, exe, options);
|
try common(b, exe, options);
|
||||||
|
{
|
||||||
|
var opt = b.addOptions();
|
||||||
|
opt.addOption(
|
||||||
|
[]const u8,
|
||||||
|
"git_commit",
|
||||||
|
b.option([]const u8, "git_commit", "Current git commit") orelse "dev",
|
||||||
|
);
|
||||||
|
exe.root_module.addImport("build_info", opt.createModule());
|
||||||
|
}
|
||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
|
|
||||||
// run
|
// run
|
||||||
|
|||||||
Reference in New Issue
Block a user