Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b329bc73e1 | |||
| cd8a9b0c76 | |||
| 4405bf4ab0 | |||
| f5acf8af4e | |||
| 6510314dea | |||
| ea5dc4d144 |
@@ -3,8 +3,17 @@ run-name: ${{ gitea.actor }} is building
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
release:
|
||||
name: ${{ matrix.target }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- target: x86_64-linux-musl
|
||||
- target: x86_64-linux-gnu
|
||||
- target: x86_64-windows
|
||||
steps:
|
||||
- run: printenv
|
||||
- name: Check out repository
|
||||
@@ -14,9 +23,12 @@ jobs:
|
||||
fetch-tags: ''
|
||||
- run: wget http://172.17.0.1:8081/repository/ziglang.org/download/0.14.1/zig-x86_64-linux-0.14.1.tar.xz
|
||||
- run: tar xfv zig-x86_64-linux-0.14.1.tar.xz
|
||||
- run: ./zig-x86_64-linux-0.14.1/zig build -Doptimize=ReleaseSmall
|
||||
- run: ./zig-x86_64-linux-0.14.1/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-windows
|
||||
|
||||
- run: ./zig-x86_64-linux-0.14.1/zig build -Doptimize=ReleaseSmall -Dtarget=${{ matrix.target }} -Dexe_name=zig-totp-$GITHUB_REF_NAME-${{ matrix.target }}
|
||||
- name: upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: zig-totp-${{matrix.target }}
|
||||
path: zig-out
|
||||
|
||||
|
||||
|
||||
|
||||
15
build.zig
15
build.zig
@@ -124,6 +124,21 @@ fn getVersion(b: *std.Build) std.SemanticVersion {
|
||||
}
|
||||
return totp_version;
|
||||
},
|
||||
1 => {
|
||||
// prerelease version: 1.0.0-dev
|
||||
var iter = std.mem.splitScalar(u8, output_trimmed, '-');
|
||||
const tag = iter.first();
|
||||
const pre_release = iter.next().?;
|
||||
|
||||
const v: std.SemanticVersion = std.SemanticVersion.parse(tag) catch unreachable;
|
||||
|
||||
return .{
|
||||
.major = v.major,
|
||||
.minor = v.minor,
|
||||
.patch = v.patch,
|
||||
.pre = b.fmt("{s}", .{pre_release}),
|
||||
};
|
||||
},
|
||||
2 => {
|
||||
// development version, e.g. 1.0.0-7-64es356
|
||||
var iter = std.mem.splitScalar(u8, output_trimmed, '-');
|
||||
|
||||
Reference in New Issue
Block a user