checkpoint
This commit is contained in:
parent
f64083083f
commit
d9216c3c10
4 changed files with 75 additions and 4 deletions
41
.github/workflows/build.yml
vendored
Normal file
41
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: Build CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
release:
|
||||
types: [published]
|
||||
check_suite:
|
||||
types: [rerequested]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-18.04
|
||||
container: debian:buster
|
||||
|
||||
steps:
|
||||
- name: install dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get --no-install-recommends -y install build-essential git
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: build
|
||||
run: |
|
||||
docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) emscripten/emsdk ./build.sh
|
||||
|
||||
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
name: publish
|
||||
run: |
|
||||
git branch -D gh-pages || true
|
||||
python3 import.py | git fast-import --date-format=now
|
||||
git config user.email "jepler@gmail.com"
|
||||
git config user.name "Jeff Epler (github actions)"
|
||||
git remote set-url --push origin https://jepler:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Web pages
|
||||
path: output/
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,3 +1 @@
|
|||
/index.html
|
||||
/index.js
|
||||
/index.was*
|
||||
/output
|
||||
|
|
|
|||
4
build.sh
4
build.sh
|
|
@ -1,2 +1,4 @@
|
|||
#!/bin/sh
|
||||
EMCC_DEBUG=1 emcc -g4 -Wall -Werror -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=1 -s ASSERTIONS=2 -DASSERTIONS=2 -s FORCE_FILESYSTEM=1 -s EXPORTED_RUNTIME_METHODS="['ccall']" -DPACKAGE_STRING=\"bdftopcf\" -I . *.c -o index.html --shell-file shell.html
|
||||
mkdir output
|
||||
|
||||
emcc -Wall -Werror -s SAFE_HEAP=1 -s STACK_OVERFLOW_CHECK=1 -s ASSERTIONS=2 -s FORCE_FILESYSTEM=1 -s EXPORTED_RUNTIME_METHODS="['ccall']" -DPACKAGE_STRING=\"bdftopcf\" -I . *.c -o output/index.html --shell-file shell.html
|
||||
|
|
|
|||
30
import.py
Executable file
30
import.py
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/python3
|
||||
import argparse
|
||||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("branch", default="gh-pages", nargs="?")
|
||||
args = parser.parse_args()
|
||||
|
||||
version = subprocess.getoutput("git describe --always")
|
||||
|
||||
fd = os.fdopen(sys.stdout.fileno(), 'wb')
|
||||
|
||||
fd.write(b"commit refs/heads/" + args.branch.encode('utf-8') + b"\n")
|
||||
fd.write(b"committer Doc Man <noreply@example.com> now" + b"\n")
|
||||
fd.write(b"data <<EOF" + b"\n")
|
||||
fd.write(b"Docs built at " + version.encode('utf-8') + b"\n")
|
||||
fd.write(b"EOF" + b"\n")
|
||||
|
||||
files = glob.glob("doc/*")
|
||||
for fn in files:
|
||||
with open(fn, 'rb') as f: contents = f.read()
|
||||
fd.write(b"M 644 inline " + os.path.basename(fn).encode('utf-8') + b"\n")
|
||||
fd.write(b"data " + str(len(contents)).encode("utf-8") + b"\n")
|
||||
fd.write(contents)
|
||||
fd.write(b"done\n")
|
||||
|
||||
Loading…
Reference in a new issue