Compare commits

..

9 Commits

Author SHA1 Message Date
168c917e04 remove matrix build
All checks were successful
Build / build (push) Successful in 27s
the non-matrix build is much faster
2026-01-20 07:31:01 +01:00
2cf4565fd1 add binary for linux-gnu and fix some other stuff
All checks were successful
Build / x86_64-linux-gnu (push) Successful in 21s
Build / x86_64-linux-musl (push) Successful in 21s
Build / x86_64-windows (push) Successful in 21s
Build / build (push) Successful in 28s
2026-01-20 07:26:27 +01:00
8b2c3cff79 use version in all places and create artifact for build task
All checks were successful
Build / x86_64-linux-gnu (push) Successful in 21s
Build / build (push) Successful in 24s
Build / x86_64-linux-musl (push) Successful in 21s
Build / x86_64-windows (push) Successful in 21s
2026-01-20 07:08:21 +01:00
a32f097bea try env variables
All checks were successful
Build / x86_64-linux-gnu (push) Successful in 21s
Build / build (push) Successful in 23s
Build / x86_64-linux-musl (push) Successful in 21s
Build / x86_64-windows (push) Successful in 21s
2026-01-20 07:01:10 +01:00
91b3545702 remove upload.sh, because I committed my token
All checks were successful
Build / x86_64-linux-gnu (push) Successful in 22s
Build / build (push) Successful in 24s
Build / x86_64-linux-musl (push) Successful in 22s
Build / x86_64-windows (push) Successful in 22s
2026-01-19 20:00:52 +01:00
1df9395324 add mise.toml
All checks were successful
Build / build (push) Successful in 22s
Build / x86_64-linux-gnu (push) Successful in 32s
Build / x86_64-windows (push) Successful in 21s
Build / x86_64-linux-musl (push) Successful in 21s
2026-01-19 19:42:19 +01:00
1062787e18 example for how to publish an artifact to gitea 2025-11-05 09:13:31 +01:00
dfc2a0668c build.sh automatically builds on changes 2025-11-05 09:10:49 +01:00
1cda4d05b3 add schema 2025-11-05 09:09:36 +01:00
3 changed files with 22 additions and 28 deletions

View File

@@ -1,45 +1,28 @@
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
name: Build name: Build
run-name: ${{ gitea.actor }} is building run-name: ${{ gitea.actor }} is building
on: [push] on: [push]
env:
ZIG_VERSION: 0.14.1
jobs: jobs:
build: build:
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
fetch-depth: 0 fetch-depth: 0
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/$ZIG_VERSION/zig-x86_64-linux-${ZIG_VERSION}.tar.xz
- run: tar xfv zig-x86_64-linux-0.14.1.tar.xz - run: tar xfv zig-x86_64-linux-$ZIG_VERSION.tar.xz
- run: ./zig-x86_64-linux-0.14.1/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-linux-musl - run: ./zig-x86_64-linux-$ZIG_VERSION/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-linux-musl -Dexe_name=zig-totp-x86_64-linux-musl
- run: ./zig-x86_64-linux-0.14.1/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-windows - run: ./zig-x86_64-linux-$ZIG_VERSION/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-linux-gnu -Dexe_name=zig-totp-x86_64-linux-gnu
- run: ./zig-x86_64-linux-$ZIG_VERSION/zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-windows -Dexe_name=zig-totp
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
uses: actions/checkout@v4
with:
fetch-depth: 0
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 -Dtarget=${{ matrix.target }} -Dexe_name=zig-totp-$GITHUB_REF_NAME-${{ matrix.target }}
- name: upload artifacts - name: upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: zig-totp-${{matrix.target }} name: zig-totp
path: zig-out/bin/ path: zig-out/bin/

9
build.sh Executable file
View File

@@ -0,0 +1,9 @@
find src | entr -c sh -c 'echo "\n\n\n\n" ; zig build test 2>&1 | cat; echo "\n\n\n" ; date'
# build exe for windows
# doesn't work anymore, because I added the version number as module "config" to the
# root_module. In main,zig we import the module. This only works when building
# using the build.zig file, but not when building without a build file.
#zig build-exe src/main.zig -O ReleaseSmall -fstrip -fsingle-threaded -target x86_64-windows
zig build && ./zig-out/bin/zig-totp list

2
mise.toml Normal file
View File

@@ -0,0 +1,2 @@
[tools]
zig = "0.14.1"