|
| 1 | +The idea here is a central place for some exmaple-carts for [null0](https://github.com/notnullgames/null0). I also use this as a central place to store docker containers for building them. |
| 2 | + |
| 3 | +- You will need docker installed to use these, which greatly simplifies your setup. |
| 4 | +- volume-mount your cart in `/src` |
| 5 | +- volume-mount your output-dir in `/out` |
| 6 | +- the first param is the name of the cart |
| 7 | +- put any filenames you don't want packaged in your cart, in `.cartignore` (.gitignore syntax) |
| 8 | + |
| 9 | +### available containers |
| 10 | + |
| 11 | +- `konsumer/null0-cart-c` |
| 12 | +- `konsumer/null0-cart-quickjs` |
| 13 | +- `konsumer/null0-cart-nelua` |
| 14 | +- `konsumer/null0-cart-assemblyscript` |
| 15 | +- `konsumer/null0-cart-nim` |
| 16 | +- `konsumer/null0-cart-zig` |
| 17 | +- `konsumer/null0-cart-rust` |
| 18 | +- `konsumer/null0-cart-py2wasm` |
| 19 | + |
| 20 | +### example usage |
| 21 | + |
| 22 | +```sh |
| 23 | +# build a cart from main.c (and assets) in current dir, output to ~/Desktop/tester.null0 |
| 24 | +docker run -it -v .:/src -v ~/Desktop:/out konsumer/null0-cart-c tester |
| 25 | +``` |
| 26 | + |
| 27 | +## usage in Github CI |
| 28 | + |
| 29 | +you can easily use it in Github Actions: |
| 30 | + |
| 31 | +```yml |
| 32 | +# github/workflows/publish.yml |
| 33 | + |
| 34 | +on: push |
| 35 | + |
| 36 | +jobs: |
| 37 | + build: |
| 38 | + name: Build & Publish Cart |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - name: Checkout |
| 42 | + uses: actions/checkout@v4 |
| 43 | + - name: Build C Cart |
| 44 | + run: docker run -v .:/src -v .:/out konsumer/null0-cart-c tester |
| 45 | + - name: Upload cart artifact |
| 46 | + uses: actions/upload-artifact@v4 |
| 47 | + with: |
| 48 | + name: tester |
| 49 | + path: tester.null0 |
| 50 | +``` |
| 51 | +
|
| 52 | +## development |
| 53 | +
|
| 54 | +This is really just notes for me: |
| 55 | +
|
| 56 | +```sh |
| 57 | +# build |
| 58 | +docker build -t konsumer/null0-cart-c docker -f docker/null0-cart-c.Dockerfile |
| 59 | + |
| 60 | +# test |
| 61 | +docker run -it -v ./carts/c/colorbars:/src -v ./out:/out konsumer/null0-cart-c colorbars |
| 62 | + |
| 63 | +# publish |
| 64 | +docker push konsumer/null0-cart-c |
| 65 | +``` |
0 commit comments