From cacb8540b0769a321d3956b5abac959c9fa24edc Mon Sep 17 00:00:00 2001 From: fubark Date: Sat, 6 Jan 2024 12:36:37 -0500 Subject: [PATCH] ci. --- .github/workflows/gen-docs.yml | 30 ++++++++++++++++++++++++++++-- .github/workflows/latest-build.yml | 13 +++++++++++-- build.zig | 4 ++-- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gen-docs.yml b/.github/workflows/gen-docs.yml index 19b0f4efa..1860ba38d 100644 --- a/.github/workflows/gen-docs.yml +++ b/.github/workflows/gen-docs.yml @@ -32,7 +32,33 @@ jobs: cd build cmake .. make - ls + + - name: Setup script. + uses: actions/github-script@v5 + with: + script: | + async function execCmd(name, args) { + const opts = {}; + let out = ''; + let err = ''; + opts.listeners = { + stdout: (data) => { + out += data.toString(); + }, + stderr: (data) => { + process.stderr.write(data.toString()); + } + }; + // opt.cwd = './lib'; + await exec.exec(name, args, opts); + return out; + } + const version = await execCmd('zig', ['build', 'version']); + core.exportVariable('SHORT_VERSION', version); + await execCmd('git', ['fetch', '--all', '--tags']); + const build = await execCmd('git', ['rev-list', '--count', `${version}..${context.sha}`]) + core.exportVariable('BUILD', build.trim()); + core.exportVariable('COMMIT', context.sha.substring(0, 7)); - name: Cache. uses: actions/cache@v2 @@ -50,7 +76,7 @@ jobs: - name: Generate docs. run: | - LD_LIBRARY_PATH=`pwd`/md4c/build/src zig-out/bin/cyber docs/gen-docs.cy + LD_LIBRARY_PATH=`pwd`/md4c/build/src zig-out/bin/cyber docs/gen-docs.cy -version ${{ 'v' + env.SHORT_VERSION + '-dev' }} mkdir -p docs/public mv docs/docs.html docs/public/index.html diff --git a/.github/workflows/latest-build.yml b/.github/workflows/latest-build.yml index 9049a5eba..f99c80df9 100644 --- a/.github/workflows/latest-build.yml +++ b/.github/workflows/latest-build.yml @@ -309,6 +309,15 @@ jobs: run: | wget -c https://ziglang.org/builds/zig-linux-x86_64-${{ env.ZIG_VERSION }}.tar.xz -O - | tar -xJ --strip-components=1 -C /usr/local/bin + - name: Build md4c. + run: | + git clone --depth=1 https://github.com/mity/md4c.git + cd md4c + mkdir build + cd build + cmake .. + make + - name: Setup script. uses: actions/github-script@v5 with: @@ -353,14 +362,14 @@ jobs: - name: Generate docs. (Release) if: startsWith(github.ref, 'refs/tags/') run: | - zig-out/bin/cyber docs/gen-docs.cy -version ${{'v' + env.SHORT_VERSION}} + LD_LIBRARY_PATH=`pwd`/md4c/build/src zig-out/bin/cyber docs/gen-docs.cy -version ${{'v' + env.SHORT_VERSION}} mv docs/docs-modules.md docs.md mv docs/docs.html docs.html - name: Generate docs. (Dev) if: ${{ !startsWith(github.ref, 'refs/tags/') }} run: | - zig-out/bin/cyber docs/gen-docs.cy -version "${{'v' + env.SHORT_VERSION + '-dev ' + env.BUILD + '-' + env.COMMIT}}" + LD_LIBRARY_PATH=`pwd`/md4c/build/src zig-out/bin/cyber docs/gen-docs.cy -version "${{'v' + env.SHORT_VERSION + '-dev ' + env.BUILD + '-' + env.COMMIT}}" mv docs/docs-modules.md docs.md mv docs/docs.html docs.html diff --git a/build.zig b/build.zig index 4952b1e80..a558bc83b 100644 --- a/build.zig +++ b/build.zig @@ -4,8 +4,8 @@ const config = @import("src/config.zig"); const mimalloc_lib = @import("lib/mimalloc/lib.zig"); const tcc_lib = @import("lib/tcc/lib.zig"); -// FIND: v0.3 -const Version = "0.3"; +// FIND: v0.4 +const Version = "0.4"; var optMalloc: ?config.Allocator = undefined; var selinux: bool = undefined;