diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37debc2..aea270c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,7 @@ jobs: run: | export PATH="/c/users/$(whoami)/.cargo/bin:$PATH" echo -e "export PATH=\"/c/users/$(whoami)/.cargo/bin:\$PATH\"\n" >> ~/.bash_profile + echo -e "export MINGW_ARCH=mingw64\n" >> ~/.bash_profile - uses: actions/checkout@v4 with: @@ -73,22 +74,38 @@ jobs: # for ffmpeg brew install ffmpeg || true - - name: Prepare msys + - name: Prepare msys dependencies if: contains(matrix.os, 'windows') run: | - set MINGW_ARCH=mingw64 # important detail: mingw-w64-x86_64-libx264 is installed for the package config files! pacman --noconfirm -S git make mingw-w64-x86_64-libx264 mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-gcc mingw-w64-x86_64-nasm mingw-w64-x86_64-opus # self compile for now # https://github.com/msys2/MINGW-packages/issues/8824 - git clone https://github.com/mirror/x264 ~/x264 + git clone --depth=1 https://github.com/mirror/x264 ~/x264 + + - name: Setup cache for x264 (Windows) + if: contains(matrix.os, 'windows') + uses: actions/cache@v4 + id: x264-cache-compiled + with: + path: ~/build-x264 + key: ${{ runner.os }}-build-${{ hashFiles('~/x264') }} + + - name: Compile x264 (Windows) + if: contains(matrix.os, 'windows') && steps.x264-cache-compiled.outputs.cache-hit != 'true' + run: | ( - cd ~/x264 - ./configure --enable-static + mkdir ~/build-x264 + cd ~/build-x264 + ../x264/configure --enable-static make -j$(nproc) ) + + - name: Prepare msys + if: contains(matrix.os, 'windows') + run: | rm /mingw64/lib/libx264.dll.a - mv ~/x264/libx264.a /mingw64/lib/libx264.a + mv ~/build-x264/libx264.a /mingw64/lib/libx264.a rustup target add x86_64-pc-windows-gnu rustup update stable rustup set default-host x86_64-pc-windows-gnu @@ -97,6 +114,8 @@ jobs: - uses: Swatinem/rust-cache@v2 - name: Build debug + # disable windows for now, since it's the slowest build + if: contains(matrix.os, 'windows') == false run: cargo build --verbose --features ${{ matrix.features-debug }} - name: Build release