6 Commits
0.0.1 ... 0.1.0

Author SHA1 Message Date
b329bc73e1 add parser for pre_release version
Some checks failed
Build / x86_64-linux-gnu (push) Failing after 18s
Build / x86_64-linux-musl (push) Failing after 18s
Build / x86_64-windows (push) Failing after 18s
2025-08-02 12:45:53 +02:00
cd8a9b0c76 try upload-artifact@v3
Some checks failed
Build / x86_64-linux-gnu (push) Failing after 18s
Build / x86_64-linux-musl (push) Failing after 18s
Build / x86_64-windows (push) Failing after 18s
2025-08-02 12:34:32 +02:00
4405bf4ab0 try caching
All checks were successful
Build / build (push) Successful in 22s
Build / x86_64-linux-gnu (push) Successful in 54s
Build / x86_64-linux-musl (push) Successful in 54s
Build / x86_64-windows (push) Successful in 53s
2025-08-02 12:28:08 +02:00
f5acf8af4e use target zig understands
All checks were successful
Build / x86_64-linux-gnu (push) Successful in 26s
Build / x86_64-linux-musl (push) Successful in 24s
Build / x86_64-windows (push) Successful in 23s
Build / build (push) Successful in 30s
2025-08-02 10:44:50 +02:00
6510314dea forgot the target
Some checks failed
Build / build (push) Successful in 21s
Build / x86_64-unknown-linux-musl (push) Failing after 15s
Build / x86_64-windows (push) Successful in 19s
2025-08-02 10:37:01 +02:00
ea5dc4d144 try matrix build
Some checks failed
Build / build (push) Successful in 21s
Build / x86_64-unknown-linux-musl (push) Failing after 15s
Build / x86_64-windows (push) Failing after 15s
2025-08-02 10:34:54 +02:00
2 changed files with 31 additions and 4 deletions

View File

@@ -3,8 +3,17 @@ run-name: ${{ gitea.actor }} is building
on: [push] on: [push]
jobs: jobs:
build:
release:
name: ${{ matrix.target }}
runs-on: ubuntu-latest 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: steps:
- run: printenv - run: printenv
- name: Check out repository - name: Check out repository
@@ -14,9 +23,12 @@ jobs:
fetch-tags: '' 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: 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: 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=${{ matrix.target }} -Dexe_name=zig-totp-$GITHUB_REF_NAME-${{ matrix.target }}
- run: ./zig-x86_64-linux-0.14.1/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-windows - name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: zig-totp-${{matrix.target }}
path: zig-out

View File

@@ -124,6 +124,21 @@ fn getVersion(b: *std.Build) std.SemanticVersion {
} }
return totp_version; 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 => { 2 => {
// development version, e.g. 1.0.0-7-64es356 // development version, e.g. 1.0.0-7-64es356
var iter = std.mem.splitScalar(u8, output_trimmed, '-'); var iter = std.mem.splitScalar(u8, output_trimmed, '-');