looper/.forgejo/workflows/compile.yaml
Zachary Hall 1563acbd83
Some checks failed
Build / download-system-deps (push) Successful in 44s
Build / build-gentoo (push) Successful in 1m47s
Build / get-source-code (push) Successful in 3m39s
Build / build-appimage (push) Successful in 39s
Build / build-android (push) Successful in 13m36s
Build / build-windows (push) Failing after 1m44s
Add Git repo to source archive
2024-10-21 13:41:11 -07:00

162 lines
6.5 KiB
YAML

name: Build
run-name: Build the project
on: [push]
jobs:
download-system-deps:
runs-on: ubuntu-latest
steps:
- name: Download and cache system dependencies
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
with:
packages: zstd cmake build-essential python3 python3-pip python3-venv wget gcc-mingw-w64 g++-mingw-w64 ninja-build binutils-mingw-w64-x86-64
version: 1.0
get-source-code:
runs-on: ubuntu-latest
needs: download-system-deps
steps:
- name: Download and cache system dependencies
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
with:
packages: zstd
version: 1.0
- name: Check out repository code
uses: actions/checkout@v3
with:
submodules: recursive
ref: main
fetch-depth: 0
- name: Set up SDL android project
run: ./setup.sh && ./setup-android-project.sh
- name: Create archive
run: rm source.tar.zst -f; tar -c --to-stdout --exclude=source.tar.zst ./* ./.* | zstd -19 -T0 -o source.tar.zst
- name: Upload source code
uses: actions/upload-artifact@v3
with:
name: source_archive
path: source.tar.zst
compression-level: 9
overwrite: true
include-hidden-files: true
if-no-files-found: error
build-appimage:
runs-on: ubuntu-latest
needs: get-source-code
steps:
- name: Download and cache system dependencies
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
with:
packages: zstd wget python3 python3-pip python3-venv cmake build-essential
version: 1.0
- name: Download repository code
uses: actions/download-artifact@v3
with:
name: source_archive
path: .
- name: Extract repository code
run: tar -xf source.tar.zst
- name: Cache python dependencies
id: cache-python-deps
uses: actions/cache@v4
with:
key: python-deps-${{ runner.os }}-python-${{ hashFiles('.forgejo/**') }}
path: venv
restore-keys: |
python-deps-${{ runner.os }}-python
- name: Create virtual environment and install Python dependencies
if: steps.cache-python-deps.cache-hit != 'true'
run: python3 -m venv venv && ./venv/bin/pip install pylddwrap
- name: Build project
run: ./build-appimage.sh
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: build
path: build/Looper.AppImage
build-gentoo:
runs-on: gentoo
steps:
- name: Stop GPG from erroring out
run: pkill gpg || true; rm -f ~/.gnupg/public-keys.d/*.lock || true
- name: Build binary package
run: emerge -v media-sound/looper
build-android:
runs-on: ubuntu-latest
needs: get-source-code
steps:
- name: Download and cache system dependencies
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
with:
packages: zstd cmake build-essential ninja-build
version: 1.0
- name: Download repository code
uses: actions/download-artifact@v3
with:
name: source_archive
path: .
- name: Extract repository code
run: tar -xf source.tar.zst
- name: Cache protobuf
uses: actions/cache@v3
with:
key: ${{ hashFiles('./build-protoc.sh', 'subprojects/protobuf' ) }}
path: subprojects/build-protobuf
- name: Build protoc
run: ./build-protoc.sh
- name: Setup Java
uses: fam-tech/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Setup Android SDK
uses: https://complecwaft.com/catmeow/setup-android@v2.0.10
- name: Build Debug apk
run: cd sdl-android-project && ./gradlew assembleDebug --stacktrace
- name: Build Debug bundle
run: cd sdl-android-project && ./gradlew bundleDebug --stacktrace
- name: Get debug file aab path
id: debugAab
run: echo "aabfile=$(find sdl-android-project/app/build/outputs/bundle/debug/*.aab)" >> $GITHUB_OUTPUT
- name: Get debug file apk path
id: debugApk
run: echo "apkfile=$(find sdl-android-project/app/build/outputs/apk/debug/*.apk)" >> $GITHUB_OUTPUT
- name: Zip Files
uses: https://complecwaft.com/catmeow/action-zip@v1
with:
files: ${{ steps.debugAab.outputs.aabfile }} ${{ steps.debugApk.outputs.apkfile }}
dest: ${{ steps.debugApk.outputs.apkfile }}.zip
- name: Upload Debug build to Artifacts
uses: actions/upload-artifact@v3
with:
name: debug-artifacts
path: ${{ steps.debugApk.outputs.apkFile }}
build-windows:
runs-on: ubuntu-latest
needs: get-source-code
steps:
- name: Download and cache system dependencies
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
with:
packages: zstd cmake build-essential gcc-mingw-w64 g++-mingw-w64 ninja-build binutils-mingw-w64-x86-64
version: 1.0
- name: Download repository code
uses: actions/download-artifact@v3
with:
name: source_archive
path: .
- name: Extract repository code
run: tar -xf source.tar.zst
- name: Cache protobuf
uses: actions/cache@v3
with:
key: ${{ hashFiles('./build-protoc.sh', 'subprojects/protobuf' ) }}
path: subprojects/build-protobuf
- name: Build protoc
run: ./build-protoc.sh
- name: Build with CMake
run: mkdir -p build-windows && cd build-windows && cmake .. -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-gcc -G Ninja -DDISABLE_GTK_UI=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_LIBFMT=ON -DUSE_PORTALS=OFF -DENABLE_DBUS=OFF -DBUILD_STATIC=ON -DDOWNLOAD_AUDIO_CODECS_DEPENDENCY=ON -DSDL_MIXER_X_SHARED=OFF -DSDL_MIXER_X_STATIC=ON -DUSE_OGG_VORBIS_STB=ON -DUSE_OPUS=OFF -DUSE_MODPLUG=OFF -DUSE_GME=OFF -DUSE_WAVPACK=OFF -DUSE_XMP=OFF -DUSE_MIDI_EDMIDI=OFF -DUSE_SYSTEM_SDL2=ON -DBUILD_PROTOC=OFF -DBUILD_SDL=ON -DBUILD_SDL_IMAGE=ON -DBUILD_JSONCPP=ON -DBUILD_SOUNDTOUCH=ON -DBUILD_PROTOBUF=ON -DDISABLE_IMGUI_UI=OFF -D BUILD_FMT=ON && ninja && cd ..
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: windows-artifacts
path: build-windows/looper.exe