Fix repository parsing and GUI action startup #8
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: Build Portable Releases | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-portables: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: linux-appimage-x86_64 | |
| platform: linux | |
| os: ubuntu-22.04 | |
| linux_appimage_arch: x86_64 | |
| artifact_name: ia-interact-linux-x86_64-appimage | |
| artifact_path: release/ia-interact-linux-x86_64.AppImage | |
| - target: linux-appimage-aarch64 | |
| platform: linux | |
| os: ubuntu-24.04-arm | |
| linux_appimage_arch: aarch64 | |
| artifact_name: ia-interact-linux-aarch64-appimage | |
| artifact_path: release/ia-interact-linux-aarch64.AppImage | |
| - target: windows-exe-x86_64 | |
| platform: windows | |
| os: windows-latest | |
| windows_arch_suffix: x86_64 | |
| artifact_name: ia-interact-windows-x86_64-exe | |
| artifact_path: release/ia-interact-windows-x86_64.exe | |
| - target: windows-exe-arm64 | |
| platform: windows | |
| os: windows-11-arm | |
| windows_arch_suffix: arm64 | |
| artifact_name: ia-interact-windows-arm64-exe | |
| artifact_path: release/ia-interact-windows-arm64.exe | |
| - target: macos-app-universal | |
| platform: macos | |
| os: macos-14 | |
| artifact_name: ia-interact-macos-universal-app | |
| artifact_path: release/ia-interact-macos-universal.app.zip | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build dependencies (Linux/macOS) | |
| if: matrix.platform != 'windows' | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements-build.txt | |
| - name: Install build dependencies (Windows) | |
| if: matrix.platform == 'windows' | |
| shell: pwsh | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements-build.txt | |
| - name: Build Linux AppImage | |
| if: matrix.platform == 'linux' | |
| run: | | |
| chmod +x scripts/build-appimage.sh | |
| APPIMAGE_ARCH=${{ matrix.linux_appimage_arch }} scripts/build-appimage.sh | |
| - name: Build Windows .exe | |
| if: matrix.platform == 'windows' | |
| shell: pwsh | |
| run: | | |
| pyinstaller --clean --onefile --name ia-interact --icon assets/icons/internet-archive.ico ia-interact.py | |
| New-Item -ItemType Directory -Path release -Force | Out-Null | |
| Copy-Item dist/ia-interact.exe "release/ia-interact-windows-${{ matrix.windows_arch_suffix }}.exe" | |
| - name: Build macOS .icns icon | |
| if: matrix.platform == 'macos' | |
| run: | | |
| mkdir -p build/ia-interact.iconset | |
| for size in 16 32 128 256 512; do | |
| sips -z "${size}" "${size}" assets/icons/internet-archive.png --out "build/ia-interact.iconset/icon_${size}x${size}.png" | |
| sips -z "$((size * 2))" "$((size * 2))" assets/icons/internet-archive.png --out "build/ia-interact.iconset/icon_${size}x${size}@2x.png" | |
| done | |
| iconutil -c icns build/ia-interact.iconset -o build/internet-archive.icns | |
| - name: Build macOS universal .app bundle archive | |
| if: matrix.platform == 'macos' | |
| run: | | |
| pyinstaller --clean --onedir --windowed --target-architecture universal2 --name ia-interact --icon build/internet-archive.icns ia-interact.py | |
| mkdir -p release | |
| ditto -c -k --sequesterRsrc --keepParent dist/ia-interact.app release/ia-interact-macos-universal.app.zip | |
| - name: Upload portable artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ matrix.artifact_name }} | |
| path: ${{ matrix.artifact_path }} | |
| if-no-files-found: error | |
| publish-release: | |
| name: Publish GitHub release assets | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: | |
| - build-portables | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: release-assets | |
| - name: Show release assets | |
| run: find release-assets -type f | |
| - name: Attach assets to GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: | | |
| release-assets/**/*.AppImage | |
| release-assets/**/*.exe | |
| release-assets/**/*.app.zip | |
| fail_on_unmatched_files: true |