Enable build artifact.

frunk
Lonnie 2021-08-01 20:43:38 +02:00
parent add4067e74
commit 3460022693
2 changed files with 12 additions and 1 deletions

View File

@ -6,6 +6,8 @@ packages:
- curl-dev - curl-dev
environment: environment:
version: zig-linux-x86_64-0.9.0-dev.689+507dc1f2e version: zig-linux-x86_64-0.9.0-dev.689+507dc1f2e
artifacts:
- derploader/zig-out/bin/derploader
tasks: tasks:
- getzig: | - getzig: |
wget https://ziglang.org/builds/${version}.tar.xz wget https://ziglang.org/builds/${version}.tar.xz
@ -25,7 +27,8 @@ tasks:
- build: | - build: |
cd derploader cd derploader
source source-me.sh source source-me.sh
$zig build $zig build -Drelease-small=true -Dtarget=x86_64-linux-gnu -Dcpu=sandybridge -Dstrip=true -Dstatic=true
strip -s zig-out/bin/derploader
triggers: triggers:
- action: email - action: email
condition: failure condition: failure

View File

@ -18,8 +18,16 @@ pub fn build(b: *std.build.Builder) void {
// Standard release options allow the person running `zig build` to select // Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions(); const mode = b.standardReleaseOptions();
const strip = b.option(bool, "strip", "strip executable");
const static = b.option(bool, "static", "compile a static executable");
const exe = b.addExecutable("derploader", "src/main.zig"); const exe = b.addExecutable("derploader", "src/main.zig");
if (strip != null) {
exe.strip = strip.?;
}
if (static != null and static.? == true) {
exe.linkage = .static;
}
deps.addAllTo(exe); deps.addAllTo(exe);
exe.linkLibC(); exe.linkLibC();
exe.linkSystemLibrary("libcurl"); exe.linkSystemLibrary("libcurl");