2023-07-15 17:31:33 -07:00
|
|
|
name: Build
|
|
|
|
run-name: Build the project
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2024-10-20 16:41:45 -07:00
|
|
|
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:
|
2024-10-21 14:51:59 -07:00
|
|
|
packages: zstd cmake build-essential python3 python3-pip python3-venv wget clang ninja-build
|
2024-10-20 16:41:45 -07:00
|
|
|
version: 1.0
|
2024-10-20 14:18:00 -07:00
|
|
|
get-source-code:
|
2023-07-15 18:22:25 -07:00
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 16:41:45 -07:00
|
|
|
needs: download-system-deps
|
2023-07-15 17:31:33 -07:00
|
|
|
steps:
|
2024-10-20 16:41:45 -07:00
|
|
|
- name: Download and cache system dependencies
|
|
|
|
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
|
|
|
|
with:
|
|
|
|
packages: zstd
|
|
|
|
version: 1.0
|
2023-07-15 17:31:33 -07:00
|
|
|
- name: Check out repository code
|
|
|
|
uses: actions/checkout@v3
|
2023-07-15 18:46:18 -07:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
2023-07-23 20:58:59 -07:00
|
|
|
ref: main
|
2023-07-21 09:47:08 -07:00
|
|
|
fetch-depth: 0
|
2024-10-20 14:18:00 -07:00
|
|
|
- name: Set up SDL android project
|
|
|
|
run: ./setup.sh && ./setup-android-project.sh
|
2024-10-20 15:30:54 -07:00
|
|
|
- name: Create archive
|
2024-10-21 13:41:11 -07:00
|
|
|
run: rm source.tar.zst -f; tar -c --to-stdout --exclude=source.tar.zst ./* ./.* | zstd -19 -T0 -o source.tar.zst
|
2024-10-20 14:18:00 -07:00
|
|
|
- name: Upload source code
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: source_archive
|
2024-10-20 15:30:54 -07:00
|
|
|
path: source.tar.zst
|
2024-10-20 14:18:00 -07:00
|
|
|
compression-level: 9
|
|
|
|
overwrite: true
|
|
|
|
include-hidden-files: true
|
|
|
|
if-no-files-found: error
|
|
|
|
build-appimage:
|
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 15:43:24 -07:00
|
|
|
needs: get-source-code
|
2024-10-20 14:18:00 -07:00
|
|
|
steps:
|
2024-10-20 16:41:45 -07:00
|
|
|
- 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
|
2024-10-20 14:18:00 -07:00
|
|
|
- name: Download repository code
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: source_archive
|
|
|
|
path: .
|
2024-10-20 15:30:54 -07:00
|
|
|
- name: Extract repository code
|
|
|
|
run: tar -xf source.tar.zst
|
2024-10-20 16:41:45 -07:00
|
|
|
- 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'
|
2024-10-20 10:50:22 -07:00
|
|
|
run: python3 -m venv venv && ./venv/bin/pip install pylddwrap
|
2023-07-18 20:43:45 -07:00
|
|
|
- name: Build project
|
2024-10-19 16:37:43 -07:00
|
|
|
run: ./build-appimage.sh
|
2024-10-19 16:43:58 -07:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
2024-10-19 16:37:43 -07:00
|
|
|
with:
|
2024-11-06 15:22:53 -08:00
|
|
|
name: appimage
|
2024-10-19 16:37:43 -07:00
|
|
|
path: build/Looper.AppImage
|
|
|
|
build-gentoo:
|
2024-10-19 17:30:05 -07:00
|
|
|
runs-on: gentoo
|
2024-10-19 16:37:43 -07:00
|
|
|
steps:
|
2024-10-20 10:11:27 -07:00
|
|
|
- name: Stop GPG from erroring out
|
|
|
|
run: pkill gpg || true; rm -f ~/.gnupg/public-keys.d/*.lock || true
|
2024-10-19 16:37:43 -07:00
|
|
|
- name: Build binary package
|
2024-10-20 10:19:04 -07:00
|
|
|
run: emerge -v media-sound/looper
|
2024-10-19 16:37:43 -07:00
|
|
|
build-android:
|
2024-10-20 09:48:01 -07:00
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 15:43:24 -07:00
|
|
|
needs: get-source-code
|
2024-10-19 16:37:43 -07:00
|
|
|
steps:
|
2024-10-20 16:41:45 -07:00
|
|
|
- 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
|
2024-10-20 14:18:00 -07:00
|
|
|
- name: Download repository code
|
|
|
|
uses: actions/download-artifact@v3
|
2024-10-19 16:37:43 -07:00
|
|
|
with:
|
2024-10-20 14:18:00 -07:00
|
|
|
name: source_archive
|
|
|
|
path: .
|
2024-10-20 15:30:54 -07:00
|
|
|
- name: Extract repository code
|
|
|
|
run: tar -xf source.tar.zst
|
2024-10-20 18:20:48 -07:00
|
|
|
- name: Cache protobuf
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
key: ${{ hashFiles('./build-protoc.sh', 'subprojects/protobuf' ) }}
|
|
|
|
path: subprojects/build-protobuf
|
2024-10-20 16:41:45 -07:00
|
|
|
- name: Build protoc
|
|
|
|
run: ./build-protoc.sh
|
2024-10-19 16:37:43 -07:00
|
|
|
- name: Setup Java
|
2024-10-20 12:36:02 -07:00
|
|
|
uses: fam-tech/setup-java@v3
|
2024-10-19 16:37:43 -07:00
|
|
|
with:
|
|
|
|
distribution: 'temurin'
|
|
|
|
java-version: 17
|
|
|
|
- name: Setup Android SDK
|
2024-10-20 12:54:04 -07:00
|
|
|
uses: https://complecwaft.com/catmeow/setup-android@v2.0.10
|
2024-10-19 16:37:43 -07:00
|
|
|
- name: Build Debug apk
|
2024-10-20 15:30:54 -07:00
|
|
|
run: cd sdl-android-project && ./gradlew assembleDebug --stacktrace
|
2024-10-19 16:37:43 -07:00
|
|
|
- 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
|
2024-10-20 12:54:04 -07:00
|
|
|
uses: https://complecwaft.com/catmeow/action-zip@v1
|
2024-10-19 16:37:43 -07:00
|
|
|
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 }}
|
2024-10-20 13:29:32 -07:00
|
|
|
build-windows:
|
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 15:43:24 -07:00
|
|
|
needs: get-source-code
|
2024-10-20 13:29:32 -07:00
|
|
|
steps:
|
2024-10-20 16:41:45 -07:00
|
|
|
- name: Download and cache system dependencies
|
|
|
|
uses: https://complecwaft.com/catmeow/cache-apt-pkgs-action@latest
|
|
|
|
with:
|
2024-10-21 14:51:59 -07:00
|
|
|
packages: zstd cmake build-essential ninja-build clang-16 git clang-tools-16
|
2024-10-20 16:41:45 -07:00
|
|
|
version: 1.0
|
2024-10-20 14:18:00 -07:00
|
|
|
- name: Download repository code
|
|
|
|
uses: actions/download-artifact@v3
|
2024-10-20 13:29:32 -07:00
|
|
|
with:
|
2024-10-20 14:18:00 -07:00
|
|
|
name: source_archive
|
|
|
|
path: .
|
2024-10-20 15:30:54 -07:00
|
|
|
- name: Extract repository code
|
|
|
|
run: tar -xf source.tar.zst
|
2024-10-20 18:20:48 -07:00
|
|
|
- name: Cache protobuf
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
key: ${{ hashFiles('./build-protoc.sh', 'subprojects/protobuf' ) }}
|
|
|
|
path: subprojects/build-protobuf
|
2024-10-20 13:29:32 -07:00
|
|
|
- name: Build protoc
|
|
|
|
run: ./build-protoc.sh
|
2024-10-21 14:51:59 -07:00
|
|
|
- name: Download and build xwin
|
|
|
|
run: wget https://github.com/Jake-Shadle/xwin/releases/download/0.6.6-rc.2/xwin-0.6.6-rc.2-x86_64-unknown-linux-musl.tar.gz -O xwin.tar.gz && tar -xf xwin.tar.gz && mv xwin*/ xwin && cd xwin && ./xwin --cache-dir /tmp/xwin-cache --accept-license splat --output /tmp/winroot && cd .. && cp clang-cl.sh /usr/local/bin/clang-cl.sh && chmod +x /usr/local/bin/clang-cl.sh
|
|
|
|
- name: Specify custom clang-cl
|
|
|
|
run: sed -i 's@clang-cl@/usr/local/bin/clang-cl.sh@g' clang-cl.cmake
|
2024-10-20 13:29:32 -07:00
|
|
|
- name: Build with CMake
|
2024-10-21 14:51:59 -07:00
|
|
|
run: mkdir -p build-windows && cd build-windows && cmake .. -DCMAKE_TOOLCHAIN_FILE=clang-cl.cmake -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 ..
|
2024-10-20 13:29:32 -07:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: windows-artifacts
|
|
|
|
path: build-windows/looper.exe
|