Skip to content

Improved packaging #184

Improved packaging

Improved packaging #184

Workflow file for this run

name: build
on: [push, pull_request, workflow_dispatch]
jobs:
build-windows-msvc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
# this runs vcvarsall for us, so we get the MSVC toolchain in PATH.
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: build yarnspin
run: |
pushd build
rc /nologo yarnspin.rc
popd
cl source\yarnspin.c build\yarnspin.res /nologo /O2 /Ob2 /Oi /Ot /Oy /MT /GL /GF /D "NDEBUG" /Fe:yarnspin.exe /link /INCREMENTAL:NO /OPT:REF /OPT:ICF /LTCG /SUBSYSTEM:CONSOLE
cl source\yarnspin.c build\yarnspin.res /nologo /O2 /Ob2 /Oi /Ot /Oy /MT /GL /GF /D "NDEBUG" /D "YARNSPIN_RUNTIME_ONLY" /Fe:runtime.exe /link /INCREMENTAL:NO /OPT:REF /OPT:ICF /LTCG /SUBSYSTEM:WINDOWS
build-windows-msvc-cpp:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
# this runs vcvarsall for us, so we get the MSVC toolchain in PATH.
- uses: seanmiddleditch/gha-setup-vsdevenv@master
- name: build yarnspin
run: |
cl /Tp source/yarnspin.c
build-windows-tcc:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- uses: robinraju/[email protected]
with:
repository: "mattiasgustavsson/tcc-build"
tag: "tcc64"
fileName: "tcc-0.9.27-win64-bin.zip"
- name: extract tcc
run: 7z x tcc-0.9.27-win64-bin.zip
- name: build yarnspin
run: |
tcc/tcc source/yarnspin.c
build-macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: brew install sdl2 glew
- name: build yarnspin
run: |
clang -o yarnspin -O2 source/yarnspin.c /usr/local/lib/libGLEW.a `sdl2-config --static-libs --cflags` -framework OpenGL -lpthread
clang -o runtime -O2 -DYARNSPIN_RUNTIME_ONLY source/yarnspin.c /usr/local/lib/libGLEW.a `sdl2-config --static-libs --cflags` -framework OpenGL -lpthread
build-macos-cpp:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: install dependencies
run: brew install sdl2 glew
- name: build yarnspin
run: |
clang++ source/yarnspin.c `sdl2-config --libs --cflags` -lGLEW -framework OpenGL -lpthread
build-linux-gcc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: robinraju/[email protected]
with:
repository: "libsdl-org/SDL"
tag: "release-2.28.1"
fileName: "SDL2-2.28.1.tar.gz"
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -qq libglew-dev
sudo apt-get install -qq llvm
sudo apt-get install -qq lld
sudo apt-get install -qq binaryen
tar -xzvf SDL2-2.28.1.tar.gz
- name: build yarnspin
run: |
cd SDL2-2.28.1
./configure --disable-shared --enable-static --prefix=$PWD/sdl2
make
make install
cd ..
gcc -o yarnspin -O2 source/yarnspin.c /usr/lib/x86_64-linux-gnu/libGLEW.a `$PWD/SDL2-2.28.1/sdl2/bin/sdl2-config --cflags` $PWD/SDL2-2.28.1/sdl2/lib/libSDL2.a -lGL -lm -lpthread
gcc -o runtime -O2 -DYARNSPIN_RUNTIME_ONLY source/yarnspin.c /usr/lib/x86_64-linux-gnu/libGLEW.a `$PWD/SDL2-2.28.1/sdl2/bin/sdl2-config --cflags` $PWD/SDL2-2.28.1/sdl2/lib/libSDL2.a -lGL -lm -lpthread
build-wasm:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
- uses: robinraju/[email protected]
with:
repository: "mattiasgustavsson/dos-like"
tag: "wasm-env"
fileName: "dos-like-wasm-build-env-win.zip"
- name: install dependencies
run: 7z x dos-like-wasm-build-env-win.zip
- name: build yarnspin
run: |
wasm\node wasm\wajicup.js source/yarnspin.c yarnspin.html
build-wasm-macos:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: robinraju/[email protected]
with:
repository: "mattiasgustavsson/dos-like"
tag: "wasm-env"
fileName: "dos-like-wasm-build-env-win.zip"
- name: install dependencies
run: |
brew install llvm binaryen
7z -y x dos-like-wasm-build-env-win.zip
- name: build yarnspin
run: |
export PATH="/usr/local/opt/llvm/bin:$PATH"
clang -cc1 -triple wasm32 -emit-obj -fcolor-diagnostics -Iwasm/ -D__WAJIC__ -isystem./wasm/system/include/libcxx -isystem./wasm/system/lib/libcxx/include -isystem./wasm/system/include/compat -isystem./wasm/system/include -isystem./wasm/system/include/libc -isystem./wasm/system/lib/libc/musl/include -isystem./wasm/system/lib/libc/musl/arch/emscripten -isystem./wasm/system/lib/libc/musl/arch/generic -mconstructor-aliases -fvisibility=hidden -fno-threadsafe-statics -fno-common -fgnuc-version=4.2.1 -D__EMSCRIPTEN__ -D_LIBCPP_ABI_VERSION=2 -D_POSIX_C_SOURCE -DNDEBUG -Os -x c -std=c99 -o runtime.o source/yarnspin.c
wasm-ld -strip-all -gc-sections --no-entry -allow-undefined -export=__wasm_call_ctors -export=main -export=__original_main -export=__main_argc_argv -export=__main_void -export=malloc ./wasm/system/system.bc runtime.o -o runtime.wasm
wasm-opt --asyncify runtime.wasm -o runtime.wasm
wasm-opt --legalize-js-interface --low-memory-unused --converge -Os runtime.wasm -o runtime.wasm
build-wasm-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: robinraju/[email protected]
with:
repository: "mattiasgustavsson/dos-like"
tag: "wasm-env"
fileName: "dos-like-wasm-build-env-win.zip"
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -qq llvm
sudo apt-get install -qq lld
sudo apt-get install -qq binaryen
7z -y x dos-like-wasm-build-env-win.zip
- name: build yarnspin
run: |
clang -cc1 -triple wasm32 -emit-obj -fcolor-diagnostics -Iwasm/ -D__WAJIC__ -isystem./wasm/system/include/libcxx -isystem./wasm/system/lib/libcxx/include -isystem./wasm/system/include/compat -isystem./wasm/system/include -isystem./wasm/system/include/libc -isystem./wasm/system/lib/libc/musl/include -isystem./wasm/system/lib/libc/musl/arch/emscripten -isystem./wasm/system/lib/libc/musl/arch/generic -mconstructor-aliases -fvisibility hidden -fno-threadsafe-statics -fno-common -fgnuc-version=4.2.1 -D__EMSCRIPTEN__ -D_LIBCPP_ABI_VERSION=2 -D_POSIX_C_SOURCE -DNDEBUG -Os -x c -std=c99 -o runtime.o source/yarnspin.c
wasm-ld -strip-all -gc-sections --no-entry -allow-undefined -export=__wasm_call_ctors -export=main -export=__original_main -export=__main_argc_argv -export=__main_void -export=malloc ./wasm/system/system.bc runtime.o -o runtime.wasm
wasm-opt --asyncify runtime.wasm -o runtime.wasm
wasm-opt --legalize-js-interface --low-memory-unused --converge -Os runtime.wasm -o runtime.wasm