publish #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish | |
on: | |
release: | |
types: [published] | |
permissions: | |
contents: write | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: robinraju/[email protected] | |
with: | |
repository: "mattiasgustavsson/docgen" | |
latest: true | |
fileName: "docgen-linux.tar.gz" | |
- name: build docs | |
run: | | |
tar -xzvf docgen-linux.tar.gz | |
./docgen docs/yarnspin.md docs/yarnspin.html | |
- name: html to pdf | |
uses: LukaszLapaj/html-to-pdf-action@master | |
with: | |
htmlFile: ./docs/yarnspin.html | |
outputFile: ./yarnspin.pdf | |
pdfOptions: '{"format": "A4", "margin": {"top": "10mm", "left": "10mm", "right": "10mm", "bottom": "10mm"}}' | |
- name: upload artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: yarnspin.pdf | |
path: ./yarnspin.pdf | |
publish-windows: | |
needs: build-docs | |
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 | |
- uses: robinraju/[email protected] | |
with: | |
repository: "mattiasgustavsson/dos-like" | |
tag: "wasm-env" | |
fileName: "dos-like-wasm-build-env-win.zip" | |
- uses: actions/download-artifact@master | |
with: | |
name: yarnspin.pdf | |
path: . | |
- name: install dependencies | |
run: 7z -y x dos-like-wasm-build-env-win.zip | |
- 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 | |
wasm\node wasm\wajicup.js source/yarnspin.c runtime.wasm | |
wasm\node wasm\wajicup.js -template build/template.html runtime.wasm runtime.html -no_minify | |
move runtime.exe build | |
move runtime.wasm build | |
move runtime.html build | |
7z a yarnspin-win.zip yarnspin.exe yarnspin.pdf faces fonts images palettes scripts sound build\runtime.exe build\runtime.wasm build\runtime.html build\template.html build\yarnspin_icon.png | |
- name: upload artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: yarnspin-win.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: upload runtime.html artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: runtime.html | |
path: ./build/runtime.html | |
- name: upload runtime.wasm artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: runtime.wasm | |
path: ./build/runtime.wasm | |
publish-macos: | |
needs: publish-windows | |
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" | |
- uses: actions/download-artifact@master | |
with: | |
name: yarnspin.pdf | |
path: . | |
- uses: actions/download-artifact@master | |
with: | |
name: runtime.html | |
path: . | |
- uses: actions/download-artifact@master | |
with: | |
name: runtime.wasm | |
path: . | |
- name: install dependencies | |
run: | | |
brew install sdl2 glew llvm binaryen | |
brew link --force llvm | |
7z -y x dos-like-wasm-build-env-win.zip | |
- name: build yarnspin | |
run: | | |
clang -o yarnspin -O2 source/yarnspin.c /usr/local/lib/libGLEW.a `sdl2-config --static-libs --cflags` -framework OpenGL -lpthread | |
chmod a+x yarnspin | |
clang -o runtime -O2 -DYARNSPIN_RUNTIME_ONLY source/yarnspin.c /usr/local/lib/libGLEW.a `sdl2-config --static-libs --cflags` -framework OpenGL -lpthread | |
chmod a+x runtime | |
mv runtime build | |
mv runtime.wasm build | |
mv runtime.html build | |
tar -czvf yarnspin-mac.tar.gz yarnspin yarnspin.pdf faces fonts images palettes scripts sound build/runtime build/runtime.wasm build/runtime.html build/template.html build/yarnspin_icon.png | |
- name: upload artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: yarnspin-mac.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish-linux: | |
needs: publish-windows | |
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" | |
- uses: robinraju/[email protected] | |
with: | |
repository: "mattiasgustavsson/dos-like" | |
tag: "wasm-env" | |
fileName: "dos-like-wasm-build-env-win.zip" | |
- uses: actions/download-artifact@master | |
with: | |
name: yarnspin.pdf | |
path: . | |
- uses: actions/download-artifact@master | |
with: | |
name: runtime.html | |
path: . | |
- uses: actions/download-artifact@master | |
with: | |
name: runtime.wasm | |
path: . | |
- 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 | |
7z -y x dos-like-wasm-build-env-win.zip | |
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 | |
chmod a+x yarnspin | |
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 | |
chmod a+x runtime | |
mv runtime build | |
mv runtime.wasm build | |
mv runtime.html build | |
tar -czvf yarnspin-linux.tar.gz yarnspin yarnspin.pdf faces fonts images palettes scripts sound build/runtime build/runtime.wasm build/runtime.html build/template.html build/yarnspin_icon.png | |
- name: upload artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: yarnspin-linux.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
cleanup: | |
needs: [publish-windows,publish-macos,publish-linux] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: yarnspin.pdf | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: runtime.html | |
- uses: geekyeggo/delete-artifact@v2 | |
with: | |
name: runtime.wasm |