build: add semantic versioning support
both nd and ngui now acquire semantic versioning recorded at the build time. they also report the version at startup and -v flag. this is useful for a release process and to avoid potential compatibility issues in the future. in a regular build flow, the version is taken from a git tag using the following command: git -C . describe --match 'v*.*.*' --tags --abbrev=8 in a non-standard scenario where git isn't available, the version can be provided on the command line during build like so: zig build -Dversion=1.2.3 if both git and command line supplied versions are available, they must match.
parent
53812cbd37
commit
1b28648d68
@ -1,18 +1,25 @@
|
|||||||
|
clone:
|
||||||
|
git:
|
||||||
|
image: woodpeckerci/plugin-git
|
||||||
|
# https://woodpecker-ci.org/plugins/Git%20Clone
|
||||||
|
settings:
|
||||||
|
# tags are required for aarch64 release builds for semver
|
||||||
|
tags: true
|
||||||
pipeline:
|
pipeline:
|
||||||
lint:
|
lint:
|
||||||
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
|
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v3
|
||||||
commands:
|
commands:
|
||||||
- ./tools/fmt-check.sh
|
- ./tools/fmt-check.sh
|
||||||
test:
|
test:
|
||||||
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
|
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v3
|
||||||
commands:
|
commands:
|
||||||
- zig build test
|
- zig build test
|
||||||
sdl2:
|
sdl2:
|
||||||
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
|
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v3
|
||||||
commands:
|
commands:
|
||||||
- zig build -Ddriver=sdl2
|
- zig build -Ddriver=sdl2
|
||||||
aarch64:
|
aarch64:
|
||||||
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v2
|
image: git.qcode.ch/nakamochi/ci-zig0.10.1:v3
|
||||||
commands:
|
commands:
|
||||||
- zig build -Ddriver=fbev -Dtarget=aarch64-linux-musl -Drelease-safe -Dstrip
|
- zig build -Ddriver=fbev -Dtarget=aarch64-linux-musl -Drelease-safe -Dstrip
|
||||||
- sha256sum zig-out/bin/nd zig-out/bin/ngui
|
- sha256sum zig-out/bin/nd zig-out/bin/ngui
|
||||||
|
Reference in New Issue