diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 78f53b34..e9291e79 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -88,7 +88,7 @@ jobs: echo "Verifying wheels using twine check" twine check dist/* - - name: Build Windows wheel (x64) + - name: Build Windows wheel if: runner.os == 'Windows' shell: pwsh run: | @@ -107,6 +107,7 @@ jobs: # Download native artifacts Write-Host "Starting artifact download process..." Write-Host "C2PA_VERSION: $env:C2PA_VERSION" + Write-Host "Architecture: ${{ inputs.architecture }}" python scripts/download_artifacts.py "$env:C2PA_VERSION" @@ -115,8 +116,15 @@ jobs: Write-Host "src/c2pa/libs directory contents:" Get-ChildItem -Recurse -Path src/c2pa/libs + # Set platform tag based on architecture + if ("${{ inputs.architecture }}" -eq "arm64") { + $PLATFORM_TAG = "win_arm64" + } else { + $PLATFORM_TAG = "win_amd64" + } + # Build wheel - python setup.py bdist_wheel --plat-name win_amd64 + python setup.py bdist_wheel --plat-name $PLATFORM_TAG # Verify wheel structure twine check dist/* diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cab3c53..5b489d21 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,7 +128,16 @@ jobs: github.event.pull_request.user.login == 'dependabot[bot]' || contains(github.event.pull_request.labels.*.name, 'safe to test') - runs-on: windows-latest + runs-on: ${{ matrix.runs-on }} + + strategy: + fail-fast: false + matrix: + include: + - runs-on: windows-latest + python-version: "3.10" + - runs-on: windows-11-arm + python-version: "3.11" # 3.10 has no win-arm64 build in actions/python-versions steps: - name: Checkout repository @@ -137,9 +146,17 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} cache: "pip" + - name: Install OpenSSL via vcpkg (Windows ARM64) + if: matrix.runs-on == 'windows-11-arm' + shell: pwsh + run: | + & "$env:VCPKG_INSTALLATION_ROOT\vcpkg.exe" install openssl:arm64-windows + $opensslRoot = "$env:VCPKG_INSTALLATION_ROOT\installed\arm64-windows" + echo "OPENSSL_DIR=$opensslRoot" >> $env:GITHUB_ENV + - name: Install project dependencies run: python -m pip install -r requirements.txt @@ -277,13 +294,17 @@ jobs: python-version: "3.10" architecture: ${{ matrix.target }} artifact-name: wheels-windows-${{ matrix.target }} - runs-on: windows-latest + runs-on: ${{ matrix.runs-on }} c2pa-version: ${{ needs.read-version.outputs.c2pa-native-version }} secrets: github-token: ${{ secrets.GITHUB_TOKEN }} strategy: matrix: - target: [x64] + include: + - target: x64 + runs-on: windows-latest + - target: arm64 + runs-on: windows-11-arm if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -294,10 +315,17 @@ jobs: test-built-windows-wheel: name: Test Windows built wheel needs: build-windows-wheel - runs-on: windows-latest + runs-on: ${{ matrix.runs-on }} strategy: + fail-fast: false matrix: - target: [x64] + include: + - target: x64 + runs-on: windows-latest + python-version: "3.10" + - target: arm64 + runs-on: windows-11-arm + python-version: "3.11" # 3.10 has no win-arm64 build in actions/python-versions if: | github.event_name != 'pull_request' || github.event.pull_request.author_association == 'COLLABORATOR' || @@ -312,7 +340,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: ${{ matrix.python-version }} cache: "pip" - name: Download wheel artifacts diff --git a/setup.py b/setup.py index 489472c1..d482b6fd 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ def get_version(): 'aarch64-apple-darwin': 'dylib', 'x86_64-apple-darwin': 'dylib', 'x86_64-pc-windows-msvc': 'dll', + 'aarch64-pc-windows-msvc': 'dll', 'x86_64-unknown-linux-gnu': 'so', 'aarch64-unknown-linux-gnu': 'so', }