diff --git a/.github/workflows/pyinstaller-release.yml b/.github/workflows/pyinstaller-release.yml new file mode 100644 index 0000000..6e90001 --- /dev/null +++ b/.github/workflows/pyinstaller-release.yml @@ -0,0 +1,216 @@ +name: PyInstaller Build and Release Binaries + +on: + push: + tags: + - "v*.*.*" + branches: [ "main", "testci" ] + workflow_dispatch: + +permissions: + contents: write + discussions: write + +env: + APP_NAME: "HwCodecDetect" + ENTRY_POINT_SCRIPT: "launcher.py" + +jobs: + build: + name: Build ${{ matrix.asset_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + # --- Windows --- + - os: windows-latest + python_arch: 'x64' + artifact_name: HwCodecDetect-Windows-x64.exe + asset_name: HwCodecDetect-Windows-x64.exe + job_type: native + + - os: windows-latest + python_arch: 'x86' # 32bit Windows + artifact_name: HwCodecDetect-Windows-x86.exe + asset_name: HwCodecDetect-Windows-x86.exe + job_type: native + + # --- macOS --- + - os: macos-13 # Intel Macs (runs on x86_64) + python_arch: 'x64' + artifact_name: HwCodecDetect-macOS-Intel + asset_name: HwCodecDetect-macOS-Intel + job_type: native + + - os: macos-latest # Apple Silicon (runs on arm64/M1/M2) + python_arch: 'arm64' + artifact_name: HwCodecDetect-macOS-ARM64 + asset_name: HwCodecDetect-macOS-ARM64 + job_type: native + + # --- Linux Native (x64) --- + - os: ubuntu-22.04 + python_arch: 'x64' + artifact_name: HwCodecDetect-Linux-x64 + asset_name: HwCodecDetect-Linux-x64 + job_type: native + + # --- Linux Emulated (ARM64 / aarch64) --- + - os: ubuntu-22.04 + job_type: emulated + qemu_arch: aarch64 + docker_img: python:3.10-bullseye + artifact_name: HwCodecDetect-Linux-arm64 + asset_name: HwCodecDetect-Linux-arm64 + + # --- Linux Emulated (x86 / i386) --- + - os: ubuntu-22.04 + job_type: emulated + qemu_arch: i386 + docker_img: i386/python:3.10-slim-bullseye + artifact_name: HwCodecDetect-Linux-x86 + asset_name: HwCodecDetect-Linux-x86 + + steps: + - uses: actions/checkout@v4 + + - name: Create Entry Point Script + shell: bash + run: | + cat > ${{ env.ENTRY_POINT_SCRIPT }} <> $GITHUB_OUTPUT + echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT + + - name: Create Release (Draft) + uses: softprops/action-gh-release@v1 + with: + tag_name: build-${{ github.ref_name }}-${{ steps.vars.outputs.date }}-${{ steps.vars.outputs.short_sha }} + name: "Build: ${{ github.ref_name }} (${{ steps.vars.outputs.date }})" + body: | + Automated multi-platform build. + Commit: ${{ github.sha }} + + ### Supported Platforms: + - **Windows**: x64, x86 (32-bit) + - **macOS**: Apple Silicon (ARM64), Intel + - **Linux**: x64, ARM64, x86 + + *Note: Windows ARM users should use the Windows x86 or x64 binary.* + draft: true + prerelease: true + files: | + artifacts/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/python-publish.yml b/.github/workflows/pypi-publish.yml similarity index 100% rename from .github/workflows/python-publish.yml rename to .github/workflows/pypi-publish.yml