Update build_deploy.yml #38
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: build and deploy (win, linux, mac, web) | |
# only run if pushed to the master branch | |
on: | |
[push, workflow_dispatch] | |
jobs: | |
build-web: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v11 | |
with: | |
actions-cache-folder: 'emsdk-cache' | |
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. | |
run: | | |
emcmake cmake -B build -DPLATFORM_SDL2=ON -DGB_SINGLE_FILE=ON -DGB_ENABLE_FORCE_INLINE=OFF -DCMAKE_BUILD_TYPE=Release | |
cmake --build build -j2 | |
# need to cleanup the cmake files | |
rm -rf build/src/platforms/sdl2/CMakeFiles | |
rm -rf build/src/platforms/sdl2/cmake_install.cmake | |
rm -rf build/src/platforms/sdl2/Makefile | |
rm -rf build/src/platforms/sdl2/res | |
cp res/netlify.toml build/src/platforms/sdl2/ | |
- name: Deploy to Netlify | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: './build/src/platforms/sdl2' | |
production-branch: master | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
deploy-message: "Deploy from GitHub Actions" | |
enable-pull-request-comment: false | |
enable-commit-comment: true | |
overwrites-pull-request-comment: true | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
timeout-minutes: 1 | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Setup vcpkg libs | |
run: | | |
vcpkg install sdl2:x64-windows zlib:x64-windows nativefiledialog:x64-windows | |
- name: Build emu | |
run: | | |
cmake -B build -DPLATFORM_SDL2=ON -DGB_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake | |
cmake --build build -j2 --config Release | |
- name: Collect files | |
run: | | |
mkdir upload | |
move build\src\platforms\sdl2\Release\*.exe upload | |
move build\src\platforms\sdl2\Release\*.dll upload | |
move build\src\platforms\sdl2\res upload\res | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: totalgb-windows | |
path: upload | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Setup vcpkg libs | |
run: | | |
vcpkg install sdl2 zlib nativefiledialog | |
- name: Build emu | |
run: | | |
cmake -B build -DPLATFORM_SDL2=ON -DGB_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake | |
cmake --build build -j3 | |
- name: Collect files | |
run: | | |
mv build/src/platforms/sdl2/TotalGB_SDL2 ./TotalGB_SDL2 | |
mv build/src/platforms/sdl2/res ./res | |
tar -cvf ./TotalGB_SDL2.tar ./TotalGB_SDL2 ./res | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: totalgb-macos | |
path: TotalGB_SDL2.tar | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Setup vcpkg libs | |
run: | | |
vcpkg install sdl2[x11] zlib nativefiledialog | |
- name: Build emu | |
run: | | |
cmake -B build -DPLATFORM_SDL2=ON -DGB_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake | |
cmake --build build -j2 | |
- name: Collect files | |
run: | | |
mv build/src/platforms/sdl2/TotalGB_SDL2 ./TotalGB_SDL2 | |
mv build/src/platforms/sdl2/res ./res | |
tar -cvf TotalGB_SDL2.tar ./TotalGB_SDL2 ./res | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: totalgb-linux | |
path: TotalGB_SDL2.tar | |
build-libretro-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build emu | |
run: | | |
cmake -B build -DPLATFORM_LIBRETRO=ON -DGB_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release | |
cmake --build build -j2 --config Release | |
- name: Collect files | |
run: | | |
mkdir upload/cores | |
mkdir upload/info | |
move build\src\platforms\libretro\Release\*.dll upload/cores | |
copy src/platforms/libretro/totalgb_libretro.info upload/info | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: totalgb-libretro-windows | |
path: upload | |
build-libretro-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build emu | |
run: | | |
cmake -B build -DPLATFORM_LIBRETRO=ON -DGB_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release | |
cmake --build build -j3 | |
- name: Collect files | |
run: | | |
mkdir -p upload/cores upload/info | |
mv build/src/platforms/libretro/totalgb_libretro* upload/cores | |
cp src/platforms/libretro/totalgb_libretro.info upload/info | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: totalgb-libretro-macos | |
path: upload | |
build-libretro-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Build emu | |
run: | | |
cmake -B build -DPLATFORM_LIBRETRO=ON -DGB_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release | |
cmake --build build -j2 | |
- name: Collect files | |
run: | | |
mkdir -p upload/cores upload/info | |
mv build/src/platforms/libretro/totalgb_libretro.so upload/cores | |
cp src/platforms/libretro/totalgb_libretro.info upload/info | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: totalgb-libretro-linux | |
path: upload | |
build-nx: | |
runs-on: ubuntu-latest | |
container: devkitpro/devkita64:latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Get latest CMake and ninja | |
# Using 'latest' branch, the most recent CMake and ninja are installed. | |
uses: lukka/get-cmake@latest | |
- name: Build | |
run: | | |
cmake -B build -DPLATFORM_SDL2=ON -DGB_SINGLE_FILE=ON -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/Switch.cmake | |
cmake --build build -j2 | |
- name: Upload files | |
uses: actions/upload-artifact@master | |
with: | |
name: TotalGB_SDL2-nx | |
path: build/src/platforms/sdl2/TotalGB_SDL2.nro | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Install ninja | |
run: sudo apt-get install -y ninja-build | |
- name: setup keystore | |
run: | | |
echo $SIGNING_KEY_DEBUG | base64 -di > ./android/app/debug.keystore | |
echo $SIGNING_KEY_RELEASE | base64 -di > ./android/app/release.keystore | |
env: | |
SIGNING_KEY_DEBUG: ${{ secrets.ANDROID_DEBUG_KEYSTORE }} | |
SIGNING_KEY_RELEASE: ${{ secrets.ANDROID_RELEASE_KEYSTORE }} | |
- name: Build the app | |
run: | | |
cd ./android | |
./gradlew build | |
mv ./app/build/outputs/apk/debug/*.apk ../TotalGB_SDL2-Debug.apk | |
mv ./app/build/outputs/apk/release/*.apk ../TotalGB_SDL2-release.apk | |
env: | |
ANDROID_RELEASE_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_STORE_PASSWORD }} | |
ANDROID_RELEASE_KEY_PASSWORD: ${{ secrets.ANDROID_RELEASE_KEY_PASSWORD }} | |
ANDROID_RELEASE_KEY_ALIAS: ${{ secrets.ANDROID_RELEASE_KEY_ALIAS }} | |
ANDROID_RELEASE_KEYSTORE_PATH: ${{ secrets.ANDROID_RELEASE_KEYSTORE_PATH }} | |
ANDROID_DEBUG_KEY_STORE_PASSWORD: ${{ secrets.ANDROID_DEBUG_KEY_STORE_PASSWORD }} | |
ANDROID_DEBUG_KEY_PASSWORD: ${{ secrets.ANDROID_DEBUG_KEY_PASSWORD }} | |
ANDROID_DEBUG_KEY_ALIAS: ${{ secrets.ANDROID_DEBUG_KEY_ALIAS }} | |
ANDROID_DEBUG_KEYSTORE_PATH: ${{ secrets.ANDROID_DEBUG_KEYSTORE_PATH }} | |
- name: Upload debug | |
uses: actions/upload-artifact@master | |
with: | |
name: TotalGB_SDL2-android-debug | |
path: ./TotalGB_SDL2-Debug.apk | |
- name: Upload release | |
uses: actions/upload-artifact@master | |
with: | |
name: TotalGB_SDL2-android-release | |
path: ./TotalGB_SDL2-release.apk |