From 6c03826e74e0d09e0aeea779e56e028e88c34670 Mon Sep 17 00:00:00 2001 From: Peter Rudenko Date: Sat, 25 May 2024 13:56:54 +0400 Subject: [PATCH] Set up CI --- .github/workflows/cmake-single-platform.yml | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/cmake-single-platform.yml diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml new file mode 100644 index 0000000..8217833 --- /dev/null +++ b/.github/workflows/cmake-single-platform.yml @@ -0,0 +1,41 @@ +name: CMake on a single platform +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] +env: + BUILD_TYPE: MinSizeRel +permissions: + contents: write +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: peterrudenko/alien-algebra + submodules: recursive + fetch-depth: 8 + - name: Install Cheerp + run: | + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 84540D4B9BF457D5 + sudo add-apt-repository ppa:leaningtech-dev/cheerp-ppa + sudo apt-get update + sudo apt-get install cheerp-core + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=/opt/cheerp/bin/clang -DCMAKE_CXX_COMPILER=/opt/cheerp/bin/clang++ -DBUILD_WEB_CLIENT=ON -G "CodeBlocks - Unix Makefiles" + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target WebGame -- -j 2 + - name: Copy static files + run: | + mkdir ${{github.workspace}}/public + cp Source/index.html ${{github.workspace}}/public/ + cp ${{github.workspace}}/build/game.js ${{github.workspace}}/public/ + ls -la ${{github.workspace}}/public + - name: Deploy + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./public + publish_branch: gh-pages