Add unified Xbox Package Lab #61
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Python ${{ matrix.python }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python: ["3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install dependencies | |
| run: python -m pip install -r requirements.txt -r requirements-dev.txt | |
| - name: Check high-confidence Python errors | |
| run: python -m ruff check . | |
| - name: Compile Python modules | |
| run: python -m compileall -q . | |
| - name: Check version consistency | |
| run: python scripts/check_version.py | |
| - name: Run tests | |
| run: python tests.py | |
| - name: Run legacy integration tests | |
| run: python integration_tests.py | |
| - name: Validate Linux shell scripts | |
| if: runner.os == 'Linux' | |
| run: | | |
| sh -n setup.sh | |
| sh -n run-unityscraper.sh | |
| sh -n build_linux.sh | |
| sh -n packaging/linux/install.sh | |
| sh -n packaging/linux/uninstall.sh | |
| - name: Validate macOS shell script | |
| if: runner.os == 'macOS' | |
| run: sh -n build_macos.sh | |
| windows-build: | |
| name: Windows executable | |
| runs-on: windows-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install build dependencies | |
| run: python -m pip install -r requirements.txt pyinstaller | |
| - name: Build | |
| run: python -m PyInstaller --clean --noconfirm UnityScraper.spec | |
| - name: Generate checksum | |
| shell: pwsh | |
| run: | | |
| $hash = (Get-FileHash dist\UnityScraper.exe -Algorithm SHA256).Hash.ToLower() | |
| "$hash *UnityScraper.exe" | Set-Content dist\UnityScraper.exe.sha256 | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: UnityScraper-Windows-x64 | |
| path: | | |
| dist/UnityScraper.exe | |
| dist/UnityScraper.exe.sha256 | |
| if-no-files-found: error | |
| linux-build: | |
| name: Linux executable | |
| runs-on: ubuntu-22.04 | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install desktop build dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y appstream desktop-file-utils python3-tk xvfb | |
| python -m pip install -r requirements.txt pyinstaller | |
| - name: Validate desktop metadata | |
| run: | | |
| sed -e 's|@EXEC@|/usr/bin/unityscraper|g' \ | |
| -e 's|@ICON@|io.github.trapemall.UnityScraper|g' \ | |
| packaging/linux/io.github.trapemall.UnityScraper.desktop \ | |
| > /tmp/io.github.trapemall.UnityScraper.desktop | |
| desktop-file-validate /tmp/io.github.trapemall.UnityScraper.desktop | |
| appstreamcli validate --no-net packaging/linux/io.github.trapemall.UnityScraper.metainfo.xml | |
| - name: Build Linux bundle | |
| run: ./build_linux.sh | |
| - name: Smoke test graphical executable | |
| run: | | |
| set +e | |
| xvfb-run -a timeout 8s dist/UnityScraper | |
| status=$? | |
| set -e | |
| test "$status" -eq 124 | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: UnityScraper-Linux-x86_64 | |
| path: | | |
| dist/UnityScraper-Linux-x86_64.tar.gz | |
| dist/UnityScraper-Linux-x86_64.tar.gz.sha256 | |
| if-no-files-found: error | |
| macos-build: | |
| name: macOS application | |
| runs-on: macos-14 | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install build dependencies | |
| run: python -m pip install -r requirements.txt pyinstaller | |
| - name: Build macOS application | |
| run: ./build_macos.sh | |
| - name: Validate application bundle | |
| run: | | |
| test -x dist/UnityScraper.app/Contents/MacOS/UnityScraper | |
| plutil -lint dist/UnityScraper.app/Contents/Info.plist | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: UnityScraper-macOS-arm64 | |
| path: | | |
| dist/UnityScraper-macOS-arm64.tar.gz | |
| dist/UnityScraper-macOS-arm64.tar.gz.sha256 | |
| if-no-files-found: error |