diff options
| author | Simen A. W. Olsen <hello@simenandre.no> | 2026-05-28 23:27:10 +0200 |
|---|---|---|
| committer | Simen A. W. Olsen <hello@simenandre.no> | 2026-05-28 23:27:10 +0200 |
| commit | 1eaf6a9d883a47444d0d68f4ab88bfba62c321d0 (patch) | |
| tree | a4ff9ee96580c8173620b1419537308367ebd399 /.forgejo/workflows/build-epubs.yml | |
| download | ziglang-docs-epub-1eaf6a9d883a47444d0d68f4ab88bfba62c321d0.tar.gz ziglang-docs-epub-1eaf6a9d883a47444d0d68f4ab88bfba62c321d0.zip | |
feat: add ziglang-docs-epub tool
Diffstat (limited to '.forgejo/workflows/build-epubs.yml')
| -rw-r--r-- | .forgejo/workflows/build-epubs.yml | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/.forgejo/workflows/build-epubs.yml b/.forgejo/workflows/build-epubs.yml new file mode 100644 index 0000000..676d3c2 --- /dev/null +++ b/.forgejo/workflows/build-epubs.yml @@ -0,0 +1,54 @@ +name: build-epubs + +on: + schedule: + - cron: "0 6 * * *" # daily, to catch master/new releases + push: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: docker + container: + image: docker.io/debian:trixie-slim + steps: + - name: Install prerequisites + run: | + apt-get update + apt-get install -y --no-install-recommends ca-certificates curl xz-utils git + + - uses: actions/checkout@v4 + + - name: Install Zig 0.15.2 + run: | + set -eux + arch="$(uname -m)" + tarball="zig-${arch}-linux-0.15.2.tar.xz" + curl -fSL "https://ziglang.org/download/0.15.2/${tarball}" -o /tmp/zig.tar.xz + mkdir -p /opt/zig + tar -xJf /tmp/zig.tar.xz -C /opt/zig --strip-components=1 + echo "/opt/zig" >> "$GITHUB_PATH" + + - name: Build EPUBs + run: zig build run + + - name: Commit updated EPUBs + run: | + set -eux + git config user.name "ziggy" + git config user.email "ziggy@noreply.codeberg.org" + git add epubs/ + if git diff --cached --quiet; then + echo "No EPUB changes." + exit 0 + fi + git commit -m "build: update epubs [skip ci]" + # Uses the runner token by default; set CI_PUSH_TOKEN if it lacks push rights. + if [ -n "${CI_PUSH_TOKEN:-}" ]; then + git push "https://x-access-token:${CI_PUSH_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" HEAD:main + else + git push origin HEAD:main + fi + env: + CI_PUSH_TOKEN: ${{ secrets.CI_PUSH_TOKEN }} |
