From baf7aa20d128e8881f3721cbc2b4c7218646cf14 Mon Sep 17 00:00:00 2001 From: Jason Dove <1695733+jasongdove@users.noreply.github.com> Date: Sat, 2 Aug 2025 13:50:54 +0000 Subject: [PATCH] build windows artifacts on linux (#2237) --- .github/workflows/artifacts.yml | 24 +++++++++++++++++++----- .github/workflows/pr.yml | 6 +++--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 53655069..d698df75 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -46,7 +46,7 @@ jobs: fetch-depth: 0 submodules: true - - name: Setup .NET Core + - name: Setup dotnet uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.203 @@ -157,7 +157,7 @@ jobs: - os: ubuntu-24.04-arm kind: linux target: linux-arm64 - - os: windows-latest + - os: ubuntu-latest kind: windows target: win-x64 steps: @@ -166,11 +166,25 @@ jobs: with: fetch-depth: 0 - - name: Setup .NET Core + - name: Setup dotnet uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.203 + - name: Set up MinGW + if: ${{ matrix.target == 'win-x64' }} + uses: egor-tensin/setup-mingw@v2 + with: + platform: x64 + + - name: Setup Windows Cross-Compile Tools + if: ${{ matrix.target == 'win-x64' }} + run: | + rustup target add x86_64-pc-windows-gnu + mkdir -p .cargo + echo '[target.x86_64-pc-windows-gnu]' >> .cargo/config.toml + echo 'linker = "x86_64-w64-mingw32-gcc"' >> .cargo/config.toml + - name: Clean run: dotnet clean --configuration Release && dotnet nuget locals all --clear @@ -199,7 +213,7 @@ jobs: # Build Windows launcher if [ "${{ matrix.kind }}" == "windows" ]; then - cargo build --manifest-path=ErsatzTV-Windows/Cargo.toml --release --all-features & + cargo build --manifest-path=ErsatzTV-Windows/Cargo.toml --release --all-features --target x86_64-pc-windows-gnu & fi wait @@ -210,7 +224,7 @@ jobs: if [ "${{ matrix.kind }}" == "windows" ]; then ls -l ErsatzTV-Windows/target/release - mv ErsatzTV-Windows/target/release/ersatztv_windows.exe "$release_name/ErsatzTV-Windows.exe" + mv ErsatzTV-Windows/target/x86_64-pc-windows-gnu/release/ersatztv_windows.exe "$release_name/ErsatzTV-Windows.exe" # Download ffmpeg 7z e "ffmpeg/${{ steps.downloadffmpeg.outputs.filename }}" -o"$release_name" '*.exe' -r diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b0fb68e2..1a05a013 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,7 +8,7 @@ jobs: - name: Get the sources uses: actions/checkout@v4 - - name: Setup .NET Core + - name: Setup dotnet uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.203 @@ -49,7 +49,7 @@ jobs: - name: Get the sources uses: actions/checkout@v4 - - name: Setup .NET Core + - name: Setup dotnet uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.203 @@ -77,7 +77,7 @@ jobs: fetch-depth: 0 submodules: true - - name: Setup .NET Core + - name: Setup dotnet uses: actions/setup-dotnet@v4 with: dotnet-version: 9.0.203