Skip to content

Commit

Permalink
ci.
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed Jan 6, 2024
1 parent 310c2d1 commit cacb854
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/gen-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/latest-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cacb854

Please sign in to comment.