Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/actions/steam-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
steam_shared_secret:
description: "Steam shared secret for TOTP generation"
required: true
steam_branch:
description: "Steam branch to deploy to"
required: false
default: "latest"

runs:
using: "composite"
Expand Down Expand Up @@ -57,4 +61,4 @@ runs:
rootPath: build
depot1Path: windows
depot2Path: linux
releaseBranch: latest
releaseBranch: ${{ inputs.steam_branch }}
69 changes: 32 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ on:
push:
tags:
- "v*"

env:
WEBVIEW2_FIXED_VERSION: "148.0.3967.96"
branches:
- dev

jobs:
build-cm:
Expand Down Expand Up @@ -56,7 +55,8 @@ jobs:
libappindicator3-dev \
librsvg2-dev \
patchelf \
musl-tools
musl-tools \
cabextract

- name: Cache Wine build
if: matrix.platform == 'ubuntu-24.04'
Expand All @@ -73,6 +73,15 @@ jobs:
if: matrix.platform == 'ubuntu-24.04' && steps.cache-wine.outputs.cache-hit != 'true'
run: ./scripts/download-wine.sh

- name: Download WebView2 Fixed Runtime (Windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: ./scripts/download-webview2.ps1

- name: Download WebView2 Fixed Runtime (Linux)
if: matrix.platform == 'ubuntu-24.04'
run: ./scripts/download-webview2.sh

- name: Prepare sidecar files for AppImage (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
run: |
Expand All @@ -81,20 +90,7 @@ jobs:
cp src-tauri/winetricks "/tmp/lib/SS13 Launcher/"
cp src-tauri/cabextract "/tmp/lib/SS13 Launcher/"
chmod +x "/tmp/lib/SS13 Launcher/winetricks" "/tmp/lib/SS13 Launcher/cabextract"
mkdir -p src-tauri/webview2-runtime

- name: Cache WebView2 Fixed Runtime
if: matrix.platform == 'windows-latest'
id: cache-webview2
uses: actions/cache@v4
with:
path: src-tauri/webview2-runtime
key: webview2-fixed-${{ env.WEBVIEW2_FIXED_VERSION }}

- name: Download WebView2 Fixed Runtime
if: matrix.platform == 'windows-latest' && steps.cache-webview2.outputs.cache-hit != 'true'
shell: pwsh
run: ./scripts/download-webview2.ps1
cp -r src-tauri/webview2-runtime "/tmp/lib/SS13 Launcher/webview2-runtime"

- name: install frontend dependencies
run: npm install
Expand All @@ -117,9 +113,10 @@ jobs:
TAURI_BUNDLER_NEW_APPIMAGE_FORMAT: "true"
ADD_DIR: "/tmp/lib/SS13 Launcher"
with:
tagName: v__VERSION__
releaseName: "v__VERSION__"
tagName: ${{ github.ref == 'refs/heads/dev' && 'v__VERSION__-dev' || 'v__VERSION__' }}
releaseName: ${{ github.ref == 'refs/heads/dev' && 'v__VERSION__-dev' || 'v__VERSION__' }}
releaseBody: "See the assets to download this version and install."
prerelease: ${{ github.ref == 'refs/heads/dev' }}
args: --features cm_ss13 --config src-tauri/tauri.cm.conf.json ${{ matrix.args }} ${{ matrix.platform == 'ubuntu-24.04' && '--config src-tauri/tauri.linux.conf.json' || '' }}
tauriScript: ${{ matrix.platform == 'ubuntu-24.04' && 'cargo tauri' || 'npm tauri' }}

Expand Down Expand Up @@ -178,7 +175,8 @@ jobs:
libappindicator3-dev \
librsvg2-dev \
patchelf \
musl-tools
musl-tools \
cabextract

- name: Cache Wine build
if: matrix.platform == 'ubuntu-24.04'
Expand All @@ -195,6 +193,15 @@ jobs:
if: matrix.platform == 'ubuntu-24.04' && steps.cache-wine.outputs.cache-hit != 'true'
run: ./scripts/download-wine.sh

- name: Download WebView2 Fixed Runtime (Windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: ./scripts/download-webview2.ps1

- name: Download WebView2 Fixed Runtime (Linux)
if: matrix.platform == 'ubuntu-24.04'
run: ./scripts/download-webview2.sh

- name: Prepare sidecar files for AppImage (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
run: |
Expand All @@ -203,20 +210,7 @@ jobs:
cp src-tauri/winetricks "/tmp/lib/SS13 Launcher/"
cp src-tauri/cabextract "/tmp/lib/SS13 Launcher/"
chmod +x "/tmp/lib/SS13 Launcher/winetricks" "/tmp/lib/SS13 Launcher/cabextract"
mkdir -p src-tauri/webview2-runtime

- name: Cache WebView2 Fixed Runtime
if: matrix.platform == 'windows-latest'
id: cache-webview2
uses: actions/cache@v4
with:
path: src-tauri/webview2-runtime
key: webview2-fixed-${{ env.WEBVIEW2_FIXED_VERSION }}

- name: Download WebView2 Fixed Runtime
if: matrix.platform == 'windows-latest' && steps.cache-webview2.outputs.cache-hit != 'true'
shell: pwsh
run: ./scripts/download-webview2.ps1
cp -r src-tauri/webview2-runtime "/tmp/lib/SS13 Launcher/webview2-runtime"

- name: install frontend dependencies
run: npm install
Expand All @@ -241,9 +235,10 @@ jobs:
TAURI_BUNDLER_NEW_APPIMAGE_FORMAT: "true"
ADD_DIR: "/tmp/lib/SS13 Launcher"
with:
tagName: v__VERSION__
releaseName: "v__VERSION__"
tagName: ${{ github.ref == 'refs/heads/dev' && 'v__VERSION__-dev' || 'v__VERSION__' }}
releaseName: ${{ github.ref == 'refs/heads/dev' && 'v__VERSION__-dev' || 'v__VERSION__' }}
releaseBody: "See the assets to download this version and install."
prerelease: ${{ github.ref == 'refs/heads/dev' }}
args: ${{ matrix.args }} ${{ matrix.platform == 'ubuntu-24.04' && '--config src-tauri/tauri.linux.conf.json' || '' }}
updaterJsonPreferNsis: true
tauriScript: ${{ matrix.platform == 'ubuntu-24.04' && 'cargo tauri' || 'npm tauri' }}
Expand Down
30 changes: 12 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
branches:
- "**"

env:
WEBVIEW2_FIXED_VERSION: "148.0.3967.96"

jobs:
bindings-check:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -95,7 +92,8 @@ jobs:
libappindicator3-dev \
librsvg2-dev \
patchelf \
musl-tools
musl-tools \
cabextract

- name: Cache Wine build
if: matrix.platform == 'ubuntu-24.04'
Expand All @@ -112,6 +110,15 @@ jobs:
if: matrix.platform == 'ubuntu-24.04' && steps.cache-wine.outputs.cache-hit != 'true'
run: ./scripts/download-wine.sh

- name: Download WebView2 Fixed Runtime (Windows)
if: matrix.platform == 'windows-latest'
shell: pwsh
run: ./scripts/download-webview2.ps1

- name: Download WebView2 Fixed Runtime (Linux)
if: matrix.platform == 'ubuntu-24.04'
run: ./scripts/download-webview2.sh

- name: Prepare sidecar files for AppImage (ubuntu only)
if: matrix.platform == 'ubuntu-24.04'
run: |
Expand All @@ -120,20 +127,7 @@ jobs:
cp src-tauri/winetricks "/tmp/lib/SS13 Launcher/"
cp src-tauri/cabextract "/tmp/lib/SS13 Launcher/"
chmod +x "/tmp/lib/SS13 Launcher/winetricks" "/tmp/lib/SS13 Launcher/cabextract"
mkdir -p src-tauri/webview2-runtime

- name: Cache WebView2 Fixed Runtime
if: matrix.platform == 'windows-latest'
id: cache-webview2
uses: actions/cache@v4
with:
path: src-tauri/webview2-runtime
key: webview2-fixed-${{ env.WEBVIEW2_FIXED_VERSION }}

- name: Download WebView2 Fixed Runtime
if: matrix.platform == 'windows-latest' && steps.cache-webview2.outputs.cache-hit != 'true'
shell: pwsh
run: ./scripts/download-webview2.ps1
cp -r src-tauri/webview2-runtime "/tmp/lib/SS13 Launcher/webview2-runtime"

- name: Install frontend dependencies
run: npm install
Expand Down
34 changes: 21 additions & 13 deletions .github/workflows/steam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ on:
push:
tags:
- "v*"
branches:
- dev

env:
STEAMWORKS_SDK_COMMIT: "494c2d680b9e47bbc369496b57568f44ef2f6796"
WEBVIEW2_FIXED_VERSION: "148.0.3967.96"

jobs:
build-windows:
Expand Down Expand Up @@ -55,15 +56,7 @@ jobs:
New-Item -ItemType Directory -Force -Path "src-tauri/resources"
Copy-Item "steamworks_sdk/redistributable_bin/win64/steam_api64.dll" -Destination "src-tauri/resources/"

- name: Cache WebView2 Fixed Runtime
id: cache-webview2
uses: actions/cache@v4
with:
path: src-tauri/webview2-runtime
key: webview2-fixed-${{ env.WEBVIEW2_FIXED_VERSION }}

- name: Download WebView2 Fixed Runtime
if: steps.cache-webview2.outputs.cache-hit != 'true'
shell: pwsh
run: ./scripts/download-webview2.ps1

Expand Down Expand Up @@ -134,7 +127,8 @@ jobs:
libappindicator3-dev \
librsvg2-dev \
patchelf \
musl-tools
musl-tools \
cabextract

- name: Cache Wine build
id: cache-wine
Expand All @@ -150,14 +144,17 @@ jobs:
if: steps.cache-wine.outputs.cache-hit != 'true'
run: ./scripts/download-wine.sh

- name: Download WebView2 Fixed Runtime
run: ./scripts/download-webview2.sh

- name: Prepare sidecar files for AppImage
run: |
mkdir -p "/tmp/lib/CM-SS13 Launcher"
cp src-tauri/wine.tar.zst "/tmp/lib/CM-SS13 Launcher/"
cp src-tauri/winetricks "/tmp/lib/CM-SS13 Launcher/"
cp src-tauri/cabextract "/tmp/lib/CM-SS13 Launcher/"
chmod +x "/tmp/lib/CM-SS13 Launcher/winetricks" "/tmp/lib/CM-SS13 Launcher/cabextract"
mkdir -p src-tauri/webview2-runtime
cp -r src-tauri/webview2-runtime "/tmp/lib/CM-SS13 Launcher/webview2-runtime"

- name: Cache Steamworks SDK
id: cache-steamworks
Expand Down Expand Up @@ -218,6 +215,16 @@ jobs:
rm -rf steam-build/linux/share/terminfo

cp src-tauri/resources/libsteam_api.so steam-build/linux/shared/lib/
cp -r src-tauri/webview2-runtime steam-build/linux/webview2-runtime

# Patch WebKit helper binaries to use bundled ld-linux and libraries.
# sharun patches the main binary but not WebKit subprocesses, which fail
# on distros without system webkit2gtk (e.g. Steam Deck pressure-vessel).
_tmp_lib=$(grep '_tmp_lib=' steam-build/linux/bin/01-path-mapping-hardcoded.hook | cut -d'=' -f2 | tr -d '"')
for f in steam-build/linux/lib/webkit2gtk-4.1/*; do
[ -f "$f" ] && file "$f" | grep -q ELF || continue
patchelf --force-rpath --set-rpath '$ORIGIN/..' --set-interpreter "/tmp/${_tmp_lib}/ld-linux-x86-64.so.2" "$f"
done

cp scripts/steam-launch.sh steam-build/linux/launch.sh
chmod +x steam-build/linux/launch.sh
Expand All @@ -229,7 +236,7 @@ jobs:
path: steam-build/linux/
retention-days: 1

deploy-steam-production:
deploy-steam:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
steps:
Expand All @@ -243,4 +250,5 @@ jobs:
steam_app_name: "production"
steam_username: ${{ secrets.STEAM_USERNAME }}
steam_password: ${{ secrets.STEAM_PASSWORD }}
steam_shared_secret: ${{ secrets.STEAM_SHARED_SECRET }}
steam_shared_secret: ${{ secrets.STEAM_SHARED_SECRET }}
steam_branch: ${{ github.ref == 'refs/heads/dev' && 'development' || 'latest' }}
45 changes: 36 additions & 9 deletions scripts/download-webview2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,48 @@ param(

$ErrorActionPreference = "Stop"

$WebView2Version = "148.0.3967.96"
$CabUrl = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/12306b32-d97b-470c-ab29-7c2f0a4f46c1/Microsoft.WebView2.FixedVersionRuntime.148.0.3967.96.x64.cab"
Write-Host "Fetching latest WebView2 Fixed Version download URL..."

Write-Host "WebView2 Fixed Version: $WebView2Version"
$page = Invoke-WebRequest -Uri "https://developer.microsoft.com/en-us/microsoft-edge/webview2/" -UseBasicParsing
$nuxtData = ($page.Content | Select-String -Pattern '(?s)<script[^>]*id="__NUXT_DATA__"[^>]*>(.*?)</script>').Matches[0].Groups[1].Value
$json = $nuxtData | ConvertFrom-Json

# Walk the Nuxt data array to find the first x64 cab URL
$cabUrl = $null
$version = $null
for ($i = 0; $i -lt $json.Count; $i++) {
$val = $json[$i]
if ($val -is [string] -and $val -match 'FixedVersionRuntime.*\.x64\.cab$') {
$cabUrl = $val
break
}
}

for ($i = 0; $i -lt $json.Count; $i++) {
$val = $json[$i]
if ($val -is [string] -and $val -match '^\d+\.\d+\.\d+\.\d+$') {
$version = $val
break
}
}

if (-not $cabUrl) {
Write-Error "Could not find WebView2 Fixed Version x64 download URL"
exit 1
}

Write-Host "WebView2 Fixed Version: $version"
Write-Host "Download URL: $cabUrl"

if (Test-Path $OutputDir) {
Write-Host "Output directory already exists, removing: $OutputDir"
Remove-Item -Recurse -Force $OutputDir
}

$CabPath = Join-Path $env:TEMP "webview2-fixed-$WebView2Version.cab"
$ExtractDir = Join-Path $env:TEMP "webview2-extract-$WebView2Version"
$CabPath = Join-Path $env:TEMP "webview2-fixed.cab"
$ExtractDir = Join-Path $env:TEMP "webview2-extract"

Write-Host "Downloading WebView2 fixed runtime..."
Invoke-WebRequest -Uri $CabUrl -OutFile $CabPath -UseBasicParsing
Write-Host "Downloading..."
Invoke-WebRequest -Uri $cabUrl -OutFile $CabPath -UseBasicParsing

Write-Host "Extracting..."
if (Test-Path $ExtractDir) { Remove-Item -Recurse -Force $ExtractDir }
Expand All @@ -43,4 +70,4 @@ if (-not (Test-Path (Join-Path $OutputDir "msedgewebview2.exe"))) {
exit 1
}

Write-Host "WebView2 fixed runtime v$WebView2Version ready at $OutputDir"
Write-Host "WebView2 fixed runtime v$version ready at $OutputDir"
Loading
Loading