diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7116a65f..30ba4d89 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -252,8 +252,40 @@ jobs: Remove-Item $env:UWP_PFX -Force -ErrorAction SilentlyContinue } + # Windows Native AOT TLS dialer. The Mac release runner fuses the win64 zip + # from LÖVE's prebuilt binaries and cannot cross-compile this DLL, so build + # it here and inject it in the release job before scripts/build.sh win. + native-tls-win: + name: build Windows gen1tls.dll + needs: version + runs-on: windows-2022 + steps: + - uses: actions/checkout@v7 + - name: Setup .NET 8 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "8.0.x" + - name: Publish gen1tls (win-x64 Native AOT) + shell: pwsh + run: | + $out = "dist/native/win-x64" + New-Item -ItemType Directory -Force -Path $out | Out-Null + dotnet publish native/tls_dial/Gen1Tls.csproj ` + -c Release -r win-x64 -o $out + if (-not (Test-Path "$out/gen1tls.dll")) { + throw "gen1tls.dll missing after publish" + } + Get-Item "$out/gen1tls.dll" | Format-List Name, Length, LastWriteTime + - name: Upload gen1tls.dll + uses: actions/upload-artifact@v7 + with: + name: gen1tls-win-x64 + path: dist/native/win-x64/gen1tls.dll + if-no-files-found: error + retention-days: 1 + release: - needs: [version, xbox-uwp, linux-arm64] + needs: [version, xbox-uwp, linux-arm64, native-tls-win] runs-on: ${{ fromJSON(github.repository == 'bryanthaboi/gen1recomp' && '["self-hosted", "macOS"]' || '"macos-latest"') }} steps: @@ -269,6 +301,12 @@ jobs: fetch-depth: 0 fetch-tags: true + - name: Download Windows gen1tls dialer + uses: actions/download-artifact@v8 + with: + name: gen1tls-win-x64 + path: dist/native/win-x64 + - name: Import signing certificate into a temporary keychain if: github.repository == 'bryanthaboi/gen1recomp' run: | @@ -307,13 +345,21 @@ jobs: security find-identity -v -p codesigning "$KEYCHAIN_PATH" - name: Build macOS + Windows + Linux + env: + GEN1TLS_DLL: ${{ github.workspace }}/dist/native/win-x64/gen1tls.dll run: | set -euo pipefail # Sign in-build (identity auto-detected from the temp keychain); # notarize separately below so it uses secret credentials, not a # login-keychain profile. "all" also builds the Linux AppImage, # which needs no signing/notarization. + if [ ! -f "$GEN1TLS_DLL" ]; then + echo "::error::gen1tls.dll missing at $GEN1TLS_DLL (native-tls-win job)" + exit 1 + fi scripts/build.sh all --version "${{ needs.version.outputs.version }}" --no-notarize + unzip -l dist/win/gen1recomp-win64.zip | grep -F gen1tls.dll \ + || { echo "::error::Windows zip is missing gen1tls.dll"; exit 1; } - name: Build Android run: | diff --git a/native/tls_dial/README.md b/native/tls_dial/README.md index 13a1540c..141d6505 100644 --- a/native/tls_dial/README.md +++ b/native/tls_dial/README.md @@ -23,6 +23,10 @@ Ship `gen1tls.dll` (or `libgen1tls.so` / `libgen1tls.dylib`) **next to** the fused executable. Mods load it through LuaJIT FFI; no .NET runtime is required on the player's machine. +Official Windows release zips get `gen1tls.dll` from CI: a `windows-2022` +job publishes this project and `scripts/build.sh`'s Windows packaging copies +it beside `gen1recomp.exe` (see `GEN1TLS_DLL` / `dist/native/win-x64`). + ## Android On Android, the matching API is exposed as `love.system.tlsOpen` / diff --git a/scripts/build.sh b/scripts/build.sh index 5c6f8bc5..f7b934fa 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -261,6 +261,21 @@ build_win() { cp "$love_dir"/*.dll "$out_dir"/ cp "$love_dir"/license.txt "$out_dir"/ 2>/dev/null || true + # Native AOT TLS dialer for outbound wss:// (e.g. Archipelago hosted rooms). + # Release CI builds this on windows-2022 (Native AOT can't cross-compile + # win-x64 from the Mac runner) and either exports GEN1TLS_DLL or drops the + # file at dist/native/win-x64/gen1tls.dll before calling build.sh. + local tls_dll="${GEN1TLS_DLL:-}" + if [ -z "$tls_dll" ] && [ -f "$DIST/native/win-x64/gen1tls.dll" ]; then + tls_dll="$DIST/native/win-x64/gen1tls.dll" + fi + if [ -n "$tls_dll" ] && [ -f "$tls_dll" ]; then + cp "$tls_dll" "$out_dir/gen1tls.dll" + say "bundled gen1tls.dll for Windows TLS (wss://)" + else + warn "gen1tls.dll not found — Windows zip will not support wss:// (set GEN1TLS_DLL or build native/tls_dial)" + fi + # The exe's icon lives in love.exe's PE resources, so it must be patched # BEFORE the .love is appended: peresed rewrites the whole file and would # drop the fused bytes. peresed (pipx install pe_tools) has no .ico input,