From d484dd0c5f0012a0f033ce0ae884fb71a730ad27 Mon Sep 17 00:00:00 2001 From: Zachary Hall Date: Sun, 20 Oct 2024 18:20:48 -0700 Subject: [PATCH] Cache protoc build and hopefully fix Windows build --- .forgejo/workflows/compile.yaml | 12 +++++++++++- build-protoc.sh | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/compile.yaml b/.forgejo/workflows/compile.yaml index 5623390..9196db6 100644 --- a/.forgejo/workflows/compile.yaml +++ b/.forgejo/workflows/compile.yaml @@ -96,6 +96,11 @@ jobs: 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 @@ -141,10 +146,15 @@ jobs: 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=OFF -DBUILD_PROTOC=OFF -DBUILD_SDL=ON -DBUILD_SDL_IMAGE=ON -DBUILD_JSONCPP=ON -DBUILD_SOUNDTOUCH=ON -DBUILD_PROTOBUF=ON -DDISABLE_IMGUI_UI=OFF && ninja && cd .. + 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: diff --git a/build-protoc.sh b/build-protoc.sh index 27e1d24..64314ca 100755 --- a/build-protoc.sh +++ b/build-protoc.sh @@ -1,7 +1,7 @@ #!/bin/bash -pushd subprojects/protobuf -mkdir -p build-native && cd build-native -cmake .. -G Ninja -DBUILD_TESTS=OFF +pushd subprojects +mkdir -p build-protobuf && cd build-protobuf +cmake ../protobuf -G Ninja -DBUILD_TESTS=OFF ninja ninja install popd