Skip to content

Fix authenticated extraction of Smart Switch APKFILE data backups #26

Fix authenticated extraction of Smart Switch APKFILE data backups

Fix authenticated extraction of Smart Switch APKFILE data backups #26

Workflow file for this run

name: CI Smoke
on:
pull_request:
push:
branches:
- main
env:
UPX_VERSION: "5.1.0"
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install Linux Qt runtime libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libegl1 \
libgl1 \
libglib2.0-0 \
libxkbcommon0 \
libdbus-1-3 \
libx11-6 \
libxcb1 \
libxext6 \
libxrender1 \
libxi6 \
libxrandr2 \
libxcursor1 \
libsm6 \
libice6 \
libfontconfig1
- name: Sync dependencies
run: uv sync
- name: Run tests
run: uv run pytest
- name: CLI smoke
run: |
uv run smartswitch-explorer --version
QT_QPA_PLATFORM=offscreen uv run smartswitch-explorer --smoke-test
package-smoke:
name: Package Smoke (${{ matrix.profile }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
profile: linux-dir
- os: macos-14
profile: macos-app
- os: windows-latest
profile: windows-exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
- name: Install Linux Qt runtime libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libegl1 \
libgl1 \
libglib2.0-0 \
libxkbcommon0 \
libdbus-1-3 \
libx11-6 \
libxcb1 \
libxext6 \
libxrender1 \
libxi6 \
libxrandr2 \
libxcursor1 \
libsm6 \
libice6 \
libfontconfig1
- name: Install UPX (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$upxVersion = "${{ env.UPX_VERSION }}"
$extractRoot = "$env:RUNNER_TEMP\upx"
$upxExe = $null
foreach ($asset in @("win64", "win32")) {
$archive = "$env:RUNNER_TEMP\upx-$asset.zip"
$assetRoot = Join-Path $extractRoot $asset
Invoke-WebRequest -Uri "https://github.com/upx/upx/releases/download/v$upxVersion/upx-$upxVersion-$asset.zip" -OutFile $archive
Expand-Archive -Path $archive -DestinationPath $assetRoot -Force
$candidate = Get-ChildItem -Path $assetRoot -Recurse -Filter upx.exe | Select-Object -First 1
if (-not $candidate) { continue }
& $candidate.FullName --version
if ($LASTEXITCODE -eq 0) {
$upxExe = $candidate
break
}
}
if (-not $upxExe) { throw "No runnable UPX binary found after extraction." }
"UPX_DIR=$($upxExe.DirectoryName)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Sync dependencies
run: uv sync
- name: Build package smoke target
env:
PYINSTALLER_FORCE_UPX: ${{ matrix.profile == 'windows-exe' && '1' || '0' }}
run: uv run --with pyinstaller python scripts/release/build_pyinstaller.py --profile "${{ matrix.profile }}"
- name: Validate packaged binary
shell: bash
run: |
case "${{ matrix.profile }}" in
windows-exe)
./dist/smartswitch-explorer.exe --version
;;
macos-app)
"./dist/SmartSwitch Explorer.app/Contents/MacOS/SmartSwitch Explorer" --version
;;
linux-dir)
QT_QPA_PLATFORM=offscreen ./dist/smartswitch-explorer/smartswitch-explorer --smoke-test
;;
*)
echo "Unknown profile" >&2
exit 1
;;
esac