-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6c03826
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |