123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- # SuperTux
- # Copyright (C) 2021 A. Semphris <semphris@protonmail.com>
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 3
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- # This is for platforms that aren't officially supported, but for which buils can be interesting
- name: Additional platforms
- on:
- push:
- branches:
- - master
- tags:
- - '*'
- pull_request: {}
- # TODO the glbinding build
- jobs:
- bsd-solaris:
- strategy:
- fail-fast: false
- matrix:
- # TODO: Add the OpenBSD, NetBSD and Solaris VMs whenever possible
- vm_os: [freebsd]
- build_type: [Debug, Release]
- runs-on: macos-latest
- steps:
- - uses: actions/checkout@v2
- with:
- # Fetch the whole tree so git describe works
- fetch-depth: 0
- submodules: true
- - name: Build in FreeBSD
- if: ${{ matrix.vm_os == 'freebsd' }}
- env:
- BUILD_TYPE: ${{ matrix.build_type }}
- uses: vmactions/freebsd-vm@v0.1.4
- with:
- envs: 'BUILD_TYPE'
- sync: rsync
- usesh: true
- prepare: |
- pkg install -y pkgconf
- pkg install -y git
- pkg install -y cmake
- pkg install -y googletest
- pkg install -y sdl2
- pkg install -y sdl2_image
- pkg install -y openal-soft
- pkg install -y glew
- pkg install -y boost-all
- pkg install -y curl
- pkg install -y libogg
- pkg install -y libvorbis
- pkg install -y freetype
- pkg install -y libraqm
- pkg install -y glm
- run: |
- mkdir build && cd build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DWARNINGS=ON -DWERROR=ON -DBUILD_TESTS=ON -DCMAKE_INSTALL_MESSAGE=NEVER -DCMAKE_INSTALL_PREFIX=/usr -DINSTALL_SUBDIR_BIN=bin -DINSTALL_SUBDIR_SHARE=share/supertux2
- make -j3 VERBOSE=1
- make install DESTDIR="/tmp/supertux" VERBOSE=1
- ./test_supertux2
- clickable:
- strategy:
- fail-fast: false
- matrix:
- build_type: [Debug, Release]
- arch: [amd64, arm64, armhf]
- exclude:
- # For some reason, this specific build fails without any error message.
- - build_type: Debug
- arch: arm64
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v2
- with:
- # Fetch the whole tree so git describe works
- fetch-depth: 0
- submodules: true
- - name: Install clickable
- run: |
- # For whatever reason, I have to manually install runc before docker.io or containerd, else it fails because of broken dependency
- # Using apt-get because apt complains it shouldn't be used in scripts
- sudo apt-get update
- sudo apt-get install -y runc
- sudo apt-get install -y docker.io adb git python3 python3-pip
- pip3 install --user git+https://gitlab.com/clickable/clickable.git@master
- # Clickable requires a reboot/logout. This is a sneaky way to bypass that :^)
- sudo systemctl unmask docker.service
- sudo systemctl start docker.service
- - name: Build
- env:
- BUILD_TYPE: ${{ (matrix.build_type == 'Debug') && '--debug' || '' }}
- ARCH: ${{ matrix.arch }}
- run: ~/.local/bin/clickable build --verbose ${BUILD_TYPE} --arch ${ARCH} --config mk/clickable/clickable.json
- - uses: actions/upload-artifact@v2
- with:
- name: "clickable-${{ matrix.arch }}-${{ matrix.build_type }}-click"
- path: build.clickable/*.click
- if-no-files-found: ignore
- - name: Publish to Open Store
- if: ${{ github.ref == 'refs/heads/master' && matrix.build_type == 'Release' }}
- env:
- ARCH: ${{ matrix.arch }}
- OPENSTORE_KEY: ${{ secrets.OPENSTORE_KEY }}
- run: ~/.local/bin/clickable publish "* $(git log -1 --pretty=%B | head -1)" --apikey ${OPENSTORE_KEY} --config mk/clickable/clickable.json --arch ${ARCH}
- wasm:
- strategy:
- fail-fast: false
- matrix:
- build_type: ["Release", "Debug"]
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v2
- with:
- # Fetch the whole tree so git describe works
- fetch-depth: 0
- submodules: true
- - name: Install emscripten tools
- run: |
- cd ~
- sudo apt-get update
- sudo apt-get install -y git cmake build-essential curl zip
- git clone https://github.com/emscripten-core/emsdk.git
- cd emsdk
- ./emsdk install 1.40.1
- ./emsdk activate 1.40.1
- # Fixes a bug in emscripten - see https://github.com/emscripten-core/emscripten/issues/13590
- sed -i "s/\#define MALLOC_ALIGNMENT ((size_t)(2 \* sizeof(void \*)))/#define MALLOC_ALIGNMENT 16/g" upstream/emscripten/system/lib/dlmalloc.c
- # Fixes a bug with the libjpeg port - see https://github.com/emscripten-core/emscripten/pull/13878
- sed -i 's/2b581c60ae401a79bbbe748ff2deeda5acd50bfd2ea22e5926e36d34b9ebcffb6580b0ff48e972c1441583e30e21e1ea821ca0423f9c67ce08a31dffabdbe6b7/b2affe9a1688bd49fc033f4682c4a242d4ee612f1affaef532f5adcb4602efc4433c4a52a4b3d69e7440ff1f6413b1b041b419bc90efd6d697999961a9a6afb7/g' upstream/emscripten/tools/ports/libjpeg.py
- sed -i 's/https:\/\/dl.bintray.com\/homebrew\/mirror\/jpeg-9c.tar.gz/https:\/\/storage.googleapis.com\/webassembly\/emscripten-ports\/jpegsrc.v9c.tar.gz/g' upstream/emscripten/tools/ports/libjpeg.py
- - name: Install vcpkg and dependencies
- run: |
- source ~/emsdk/emsdk_env.sh
- cd ~
- git clone https://github.com/microsoft/vcpkg
- ./vcpkg/bootstrap-vcpkg.sh
- ./vcpkg/vcpkg integrate install
- ./vcpkg/vcpkg install boost-date-time:wasm32-emscripten
- ./vcpkg/vcpkg install boost-filesystem:wasm32-emscripten
- ./vcpkg/vcpkg install boost-format:wasm32-emscripten
- ./vcpkg/vcpkg install boost-locale:wasm32-emscripten
- ./vcpkg/vcpkg install boost-optional:wasm32-emscripten
- ./vcpkg/vcpkg install boost-system:wasm32-emscripten
- ./vcpkg/vcpkg install glbinding:wasm32-emscripten
- ./vcpkg/vcpkg install libpng:wasm32-emscripten
- ./vcpkg/vcpkg install libogg:wasm32-emscripten
- ./vcpkg/vcpkg install libvorbis:wasm32-emscripten
- ./vcpkg/vcpkg install glm:wasm32-emscripten
- ./vcpkg/vcpkg install zlib:wasm32-emscripten
- - name: Patch SDL_ttf
- working-directory: external/SDL_ttf
- run: git apply ../../mk/emscripten/SDL_ttf.patch
- - name: Build
- env:
- BUILD_TYPE: ${{ matrix.build_type }}
- run: |
- source ~/emsdk/emsdk_env.sh
- mkdir build
- cd build
- # TODO: Add -DWARNINGS=ON -DWERROR=ON (when the warnings will be fixed)
- emcmake cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DENABLE_OPENGLES2=ON -DCMAKE_TOOLCHAIN_FILE=~/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=wasm32-emscripten -DGLBINDING_ENABLED=ON -DEMSCRIPTEN=1 -DWARNINGS=ON -DWERROR=ON ..
- rsync -aP ../data/ data/
- emmake make -j$(nproc)
- rm supertux2.html && cp template.html supertux2.html
- mkdir upload/
- mv supertux2* upload/
- # Now you can run a local server with: `emrun supertux2.html`
- # Or any traditional web server will do the job
- # Note: opening the html file manually (file:///) won't work
- - uses: actions/upload-artifact@v2
- with:
- name: "wasm32-emscripten-${{ matrix.build_type }}-html"
- path: build/upload/*
- if-no-files-found: ignore
- - name: Upload to server
- if: ${{ github.ref == 'refs/heads/master' && matrix.build_type == 'Release' }}
- env:
- UPLOAD_URL: ${{ secrets.UPLOAD_URL }}
- run: |
- cd build/upload/
- mv supertux2.html index.html
- zip supertux2.zip *
- curl -F "archive=@$(pwd)/supertux2.zip" -F "message=$(git log --format=%B -n 1 | head -1)" $UPLOAD_URL
|