diff --git a/.github/workflows/build-workflow.yml b/.github/workflows/build-workflow.yml index b4d0ceb..27deb94 100644 --- a/.github/workflows/build-workflow.yml +++ b/.github/workflows/build-workflow.yml @@ -5,33 +5,45 @@ on: types: [created] +env: + BASE_NAME: autoknit + NEST_LIBS_VERSION: v0.13 + + jobs: build-windows: name: Build (Windows) runs-on: windows-latest steps: + - uses: ilammy/msvc-dev-cmd@v1.4.1 - name: Checkout Code uses: actions/checkout@v2 + with: + submodules: true + - name: Fetch Libraries + shell: cmd + run: | + python .github/workflows/download-file.py https://github.com/15-466/nest-libs/releases/download/%NEST_LIBS_VERSION%/nest-libs-windows-%NEST_LIBS_VERSION%.zip ../nest-libs.zip + cd .. + "C:\Program Files\7-Zip\7z.exe" x -o. nest-libs.zip - name: Build Code shell: cmd run: | dir/w - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - git clone https://github.com/ixchow/kit-libs-win + #call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" git clone https://github.com/eigenteam/eigen-git-mirror eigen - git clone https://github.com/ixchow/kit - python .github/workflows/download-jam.py - mkdir dist - "work\jam.exe" JAM_TOOLSET=VISUALC -j3 -q - env: - TAG_NAME: ${{ github.event.release.tag_name }} - - name: Package + node Maekfile.js -q + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.BASE_NAME }}-windows + path: dist + - name: Package (Release) + if: github.event_name == 'release' shell: cmd run: | - copy README.md dist - rename dist "autoknit-windows-%TAG_NAME%" - "C:\Program Files\7-Zip\7z.exe" a -r "autoknit-windows-%TAG_NAME%.zip" "autoknit-windows-%TAG_NAME%" - dir/w + rename dist "%BASE_NAME%-windows-%TAG_NAME%" + "C:\Program Files\7-Zip\7z.exe" a -r "%BASE_NAME%-windows-%TAG_NAME%.zip" "%BASE_NAME%-windows-%TAG_NAME%" env: TAG_NAME: ${{ github.event.release.tag_name }} - name: Upload Result @@ -41,8 +53,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: autoknit-windows-${{ github.event.release.tag_name }}.zip - asset_name: autoknit-windows-${{ github.event.release.tag_name }}.zip + asset_path: ${{ env.BASE_NAME }}-windows-${{ github.event.release.tag_name }}.zip + asset_name: ${{ env.BASE_NAME }}-windows-${{ github.event.release.tag_name }}.zip asset_content_type: application/zip build-linux: name: Build (Linux) @@ -50,22 +62,32 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v2 + with: + submodules: true + - name: Fetch Libraries + shell: bash + run: | + cd .. + wget https://github.com/15-466/nest-libs/releases/download/${NEST_LIBS_VERSION}/nest-libs-linux-${NEST_LIBS_VERSION}.tar.gz -Onest-libs.tar.gz + tar xfz nest-libs.tar.gz - name: Build Code shell: bash run: | - sudo apt install ftjam libglm-dev libpng-dev libsdl2-dev libeigen3-dev - git clone https://github.com/ixchow/kit - mkdir dist - jam -j3 -q - env: - TAG_NAME: ${{ github.event.release.tag_name }} + sudo apt-get update + sudo apt-get install libgl-dev libasound2-dev libeigen3-dev + ls + node Maekfile.js -q + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.BASE_NAME }}-linux + path: dist - name: Package + if: github.event_name == 'release' shell: bash run: | - cp README.md dist - mv dist "autoknit-linux-$TAG_NAME" - tar cfz "autoknit-linux-$TAG_NAME"".tar.gz" "autoknit-linux-$TAG_NAME" - ls + mv dist "$BASE_NAME""-linux-""$TAG_NAME" + tar cvfz "$BASE_NAME""-linux-""$TAG_NAME"".tar.gz" "$BASE_NAME""-linux-""$TAG_NAME" env: TAG_NAME: ${{ github.event.release.tag_name }} - name: Upload Result @@ -75,8 +97,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: autoknit-linux-${{ github.event.release.tag_name }}.tar.gz - asset_name: autoknit-linux-${{ github.event.release.tag_name }}.tar.gz + asset_path: ${{ env.BASE_NAME }}-linux-${{ github.event.release.tag_name }}.tar.gz + asset_name: ${{ env.BASE_NAME }}-linux-${{ github.event.release.tag_name }}.tar.gz asset_content_type: application/gzip build-macos: name: Build (MacOS) @@ -84,20 +106,31 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v2 + with: + submodules: true + - name: Fetch Libraries + shell: bash + run: | + cd .. + wget https://github.com/15-466/nest-libs/releases/download/${NEST_LIBS_VERSION}/nest-libs-macos-${NEST_LIBS_VERSION}.tar.gz -Onest-libs.tar.gz + tar xfz nest-libs.tar.gz + brew install eigen - name: Build Code shell: bash run: | - brew install ftjam sdl2 glm eigen libpng - git clone https://github.com/ixchow/kit - mkdir dist - jam -j3 -q + ls + node Maekfile.js -q + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.BASE_NAME }}-macos + path: dist - name: Package + if: github.event_name == 'release' shell: bash run: | - cp README.md dist - mv dist "autoknit-macos-$TAG_NAME" - tar cfz "autoknit-macos-$TAG_NAME"".tar.gz" "autoknit-macos-$TAG_NAME" - ls + mv dist "$BASE_NAME""-macos-""$TAG_NAME" + tar cvfz "$BASE_NAME""-macos-""$TAG_NAME"".tar.gz" "$BASE_NAME""-macos-""$TAG_NAME" env: TAG_NAME: ${{ github.event.release.tag_name }} - name: Upload Result @@ -107,6 +140,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: autoknit-macos-${{ github.event.release.tag_name }}.tar.gz - asset_name: autoknit-macos-${{ github.event.release.tag_name }}.tar.gz + asset_path: ${{ env.BASE_NAME }}-macos-${{ github.event.release.tag_name }}.tar.gz + asset_name: ${{ env.BASE_NAME }}-macos-${{ github.event.release.tag_name }}.tar.gz asset_content_type: application/gzip diff --git a/Maekfile.js b/Maekfile.js index 2d665c4..b9eb5f4 100644 --- a/Maekfile.js +++ b/Maekfile.js @@ -31,9 +31,6 @@ if (maek.OS === "windows") { `/I${NEST_LIBS}/SDL2/include`, `/I${NEST_LIBS}/glm/include`, `/I${NEST_LIBS}/libpng/include`, - `/I${NEST_LIBS}/opusfile/include`, - `/I${NEST_LIBS}/libopus/include`, - `/I${NEST_LIBS}/libogg/include`, `/I${NEST_LIBS}/harfbuzz/include`, `/I${NEST_LIBS}/freetype/include`, //#disable a few warnings: @@ -47,11 +44,8 @@ if (maek.OS === "windows") { `/LIBPATH:${NEST_LIBS}/SDL2/lib`, `SDL2main.lib`, `SDL2.lib`, `OpenGL32.lib`, `Shell32.lib`, `/LIBPATH:${NEST_LIBS}/libpng/lib`, `libpng.lib`, `/LIBPATH:${NEST_LIBS}/zlib/lib`, `zlib.lib`, - `/LIBPATH:${NEST_LIBS}/opusfile/lib`, `opusfile.lib`, - `/LIBPATH:${NEST_LIBS}/libopus/lib`, `opus.lib`, - `/LIBPATH:${NEST_LIBS}/libogg/lib`, `libogg.lib`, - `/LIBPATH:${NEST_LIBS}/harfbuzz/lib`, `harfbuzz.lib`, - `/LIBPATH:${NEST_LIBS}/freetype/lib`, `freetype.lib`, + //`/LIBPATH:${NEST_LIBS}/harfbuzz/lib`, `harfbuzz.lib`, + //`/LIBPATH:${NEST_LIBS}/freetype/lib`, `freetype.lib`, `/MANIFEST:EMBED`, `/MANIFESTINPUT:set-utf8-code-page.manifest` ); } else if (maek.OS === "linux") { @@ -62,22 +56,16 @@ if (maek.OS === "windows") { `-I${NEST_LIBS}/SDL2/include/SDL2`, `-D_THREAD_SAFE`, //the output of sdl-config --cflags `-I${NEST_LIBS}/glm/include`, `-I${NEST_LIBS}/libpng/include`, - `-I${NEST_LIBS}/opusfile/include`, - `-I${NEST_LIBS}/libopus/include`, - `-I${NEST_LIBS}/libogg/include`, - `-I${NEST_LIBS}/harfbuzz/include`, - `-I${NEST_LIBS}/freetype/include` + //`-I${NEST_LIBS}/harfbuzz/include`, + //`-I${NEST_LIBS}/freetype/include` ); maek.options.LINKLibs.push( //linker flags for nest libraries: `-L${NEST_LIBS}/SDL2/lib`, `-lSDL2`, `-lm`, `-ldl`, `-lasound`, `-lpthread`, `-lX11`, `-lXext`, `-lpthread`, `-lrt`, `-lGL`, //the output of sdl-config --static-libs `-L${NEST_LIBS}/libpng/lib`, `-lpng`, `-L${NEST_LIBS}/zlib/lib`, `-lz`, - `-L${NEST_LIBS}/opusfile/lib`, `-lopusfile`, - `-L${NEST_LIBS}/libopus/lib`, `-lopus`, - `-L${NEST_LIBS}/libogg/lib`, `-logg`, - `-L${NEST_LIBS}/harfbuzz/lib`, `-lharfbuzz`, - `-L${NEST_LIBS}/freetype/lib`, `-lfreetype` + //`-L${NEST_LIBS}/harfbuzz/lib`, `-lharfbuzz`, + //`-L${NEST_LIBS}/freetype/lib`, `-lfreetype` ); } else if (maek.OS === "macos") { maek.options.CPPFlags.push( @@ -88,11 +76,8 @@ if (maek.OS === "windows") { `-I${NEST_LIBS}/SDL2/include/SDL2`, `-D_THREAD_SAFE`, //the output of sdl-config --cflags `-I${NEST_LIBS}/glm/include`, `-I${NEST_LIBS}/libpng/include`, - `-I${NEST_LIBS}/opusfile/include`, - `-I${NEST_LIBS}/libopus/include`, - `-I${NEST_LIBS}/libogg/include`, - `-I${NEST_LIBS}/harfbuzz/include`, - `-I${NEST_LIBS}/freetype/include` + //`-I${NEST_LIBS}/harfbuzz/include`, + //`-I${NEST_LIBS}/freetype/include` ); maek.options.LINKLibs.push( '-I.', //for kit @@ -100,11 +85,8 @@ if (maek.OS === "windows") { `-L${NEST_LIBS}/SDL2/lib`, `-lSDL2`, `-lm`,`-liconv`, `-framework`, `CoreAudio`, `-framework`, `AudioToolbox`, `-weak_framework`, `CoreHaptics`, `-weak_framework`, `GameController`, `-framework`, `ForceFeedback`, `-lobjc`, `-framework`, `CoreVideo`, `-framework`, `Cocoa`, `-framework`, `Carbon`, `-framework`, `IOKit`, `-framework`, `OpenGL`, //the output of sdl-config --static-libs `-L${NEST_LIBS}/libpng/lib`, `-lpng`, `-L${NEST_LIBS}/zlib/lib`, `-lz`, - `-L${NEST_LIBS}/opusfile/lib`, `-lopusfile`, - `-L${NEST_LIBS}/libopus/lib`, `-lopus`, - `-L${NEST_LIBS}/libogg/lib`, `-logg`, - `-L${NEST_LIBS}/harfbuzz/lib`, `-lharfbuzz`, - `-L${NEST_LIBS}/freetype/lib`, `-lfreetype` + //`-L${NEST_LIBS}/harfbuzz/lib`, `-lharfbuzz`, + //`-L${NEST_LIBS}/freetype/lib`, `-lfreetype` ); } //use COPY to copy a file @@ -112,14 +94,12 @@ if (maek.OS === "windows") { // from: file to copy from // to: file to copy to let copies = [ + maek.COPY(`README.md`, `dist/README.md`), maek.COPY(`${NEST_LIBS}/SDL2/dist/README-SDL.txt`, `dist/README-SDL.txt`), maek.COPY(`${NEST_LIBS}/libpng/dist/README-libpng.txt`, `dist/README-libpng.txt`), maek.COPY(`${NEST_LIBS}/glm/dist/README-glm.txt`, `dist/README-glm.txt`), - maek.COPY(`${NEST_LIBS}/libopus/dist/README-libopus.txt`, `dist/README-libopus.txt`), - maek.COPY(`${NEST_LIBS}/opusfile/dist/README-opusfile.txt`, `dist/README-opusfile.txt`), - maek.COPY(`${NEST_LIBS}/libogg/dist/README-libogg.txt`, `dist/README-libogg.txt`), - maek.COPY(`${NEST_LIBS}/harfbuzz/dist/README-harfbuzz.txt`, `dist/README-harfbuzz.txt`), - maek.COPY(`${NEST_LIBS}/freetype/dist/README-freetype.txt`, `dist/README-freetype.txt`) + //maek.COPY(`${NEST_LIBS}/harfbuzz/dist/README-harfbuzz.txt`, `dist/README-harfbuzz.txt`), + //maek.COPY(`${NEST_LIBS}/freetype/dist/README-freetype.txt`, `dist/README-freetype.txt`) ]; if (maek.OS === 'windows') { copies.push( maek.COPY(`${NEST_LIBS}/SDL2/dist/SDL2.dll`, `dist/SDL2.dll`) );