Skip to content
Closed

WIP #266

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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"

Expand All @@ -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/*
Expand Down
42 changes: 35 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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' ||
Expand All @@ -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' ||
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down
Loading