name: renderers # Build downloadable KRB renderers for every platform: the headless # renderer (krb-run) as native binaries, and the web player (krb-web) # as static files any site can host. on: push: branches: [master] tags: ["v*"] workflow_dispatch: permissions: contents: write jobs: native: strategy: fail-fast: false matrix: include: - { os: ubuntu-latest, cc: cc, suffix: linux-x86_64, build_dir: build/linux-x86_64 } - { os: ubuntu-latest, cc: x86_64-w64-mingw32-gcc, suffix: windows-x86_64, build_dir: build/linux-x86_64 } - { os: macos-latest, cc: /usr/bin/clang, suffix: macos-arm64, build_dir: build/macos-arm64 } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v7 with: submodules: recursive - name: Install mingw (windows cross) if: matrix.suffix == 'windows-x86_64' run: sudo apt-get update && sudo apt-get install -y mingw-w64 - name: Install GNU make (macOS) if: runner.os == 'macOS' run: brew install make - name: Build krb-run # The Makefile's KRY_SW_SRCS is the single source of truth for what # every renderer build links; never pin a copy of the list here. run: | target="${{ matrix.build_dir }}/bin/krb-run" if [ "${{ runner.os }}" = macOS ]; then env -u MAKE -u MAKEFLAGS -u MFLAGS -u MAKEFILES \ CC=${{ matrix.cc }} /opt/homebrew/bin/gmake -e -f ./Makefile "$target" else make "$target" CC=${{ matrix.cc }} fi [ "${{ matrix.suffix }}" = windows-x86_64 ] && target="$target.exe" cp "$target" build/krb-run - name: Rename run: cp build/krb-run krb-run-${{ matrix.suffix }}${{ matrix.suffix == 'windows-x86_64' && '.exe' || '' }} - uses: actions/upload-artifact@v7 with: name: krb-run-${{ matrix.suffix }} path: krb-run-${{ matrix.suffix }}* web: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 with: submodules: recursive - uses: mymindstorm/setup-emsdk@v14 with: version: latest - name: Build web player run: make krb-web - name: Package run: | mkdir -p krb-player-web && cp build/linux-x86_64/web/krb-web/* krb-player-web/ cp examples/02_buttons.kry /tmp/ 2>/dev/null || true - uses: actions/upload-artifact@v7 with: name: krb-player-web path: krb-player-web/ exactness: # Cross-engine byte-exactness needs no GL (SDL dummy + software). # The native pixel-compare vs the inbe C build additionally needs a # working screenshot pipeline: xvfb-run, as inbe's own CI does. runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 with: submodules: recursive - name: Build tools run: | sudo apt-get update sudo apt-get install -y libsdl2-dev make build/linux-x86_64/bin/k2b \ build/linux-x86_64/bin/krb-run \ build/linux-x86_64/bin/krb-sdl \ build/linux-x86_64/tests/krb_logic_test \ build/linux-x86_64/tests/krb_asset_test - name: Cross-engine exactness run: sh tests/krb_exact_test.sh . - name: Unit tests run: | build/linux-x86_64/tests/krb_logic_test build/linux-x86_64/tests/krb_asset_test # Native gate: once inbe CI checks out kryon master as its vendor, # run tests/krb_exact_native_test.sh per ported screen under xvfb: # xvfb-run -a ./inbe --screenshot native.png --screenshot-scene language ... release: if: startsWith(github.ref, 'refs/tags/') needs: [native, web] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 - run: | mkdir rel && cp -r krb-run-* krb-player-web rel/ - uses: softprops/action-gh-release@v3 with: files: rel/*