Skip to content

Build

Build #365

Workflow file for this run

name: Build
on:
pull_request:
types:
- opened
- reopened
- synchronize
- labeled
push:
branches:
- main
tags:
- "*"
workflow_dispatch:
inputs:
publish:
description: 'Publish'
required: true
default: 'false'
jobs:
# TODO reactivate tests & debug test runs once publishing squared out
# tests:
# name: Unit tests
# if: |
# github.event_name != 'pull_request' ||
# github.event.pull_request.author_association == 'COLLABORATOR' ||
# github.event.pull_request.author_association == 'MEMBER' ||
# github.event.pull_request.user.login == 'dependabot[bot]' ||
# contains(github.event.pull_request.labels.*.name, 'safe to test')
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ windows-latest, macos-latest, ubuntu-latest ]
# rust_version: [ stable, 1.76.0 ]
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: "3.10"
# cache: "pip"
# - run: python -m pip install --upgrade pip
# - run: python -m pip install -r requirements.txt
# - run: python -m pip install pytest
# - run: pytest
linux:
runs-on: ubuntu-latest
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.author_association == 'COLLABORATOR' ||
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.user.login == 'dependabot[bot]' ||
contains(github.event.pull_request.labels.*.name, 'safe to test')
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Prepare build directories
run: |
mkdir -p artifacts
mkdir -p src/c2pa/libs
rm -rf dist/* build/*
- name: Download native artifacts (from tag c2pa-v0.55.0)
run: python3 scripts/download_artifacts.py c2pa-v0.55.0
- name: Build wheel for ${{ matrix.target }}
run: python setup.py bdist_wheel
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.target }}
path: dist
# windows:
# runs-on: windows-latest
# if: |
# github.event_name != 'pull_request' ||
# github.event.pull_request.author_association == 'COLLABORATOR' ||
# github.event.pull_request.author_association == 'MEMBER' ||
# github.event.pull_request.user.login == 'dependabot[bot]' ||
# contains(github.event.pull_request.labels.*.name, 'safe to test')
# strategy:
# matrix:
# target: [x64, x86]
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: '3.10'
# architecture: ${{ matrix.target }}
# cache: "pip"
# - name: Install dependencies
# run: pip install -r requirements.txt
# - name: Build wheel
# run: python setup.py bdist_wheel
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-${{ matrix.target }}
# path: dist
# macos_x86:
# runs-on: macos-latest
# if: |
# github.event_name != 'pull_request' ||
# github.event.pull_request.author_association == 'COLLABORATOR' ||
# github.event.pull_request.author_association == 'MEMBER' ||
# github.event.pull_request.user.login == 'dependabot[bot]' ||
# contains(github.event.pull_request.labels.*.name, 'safe to test')
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: '3.10'
# cache: "pip"
# - run:
# pip install -r requirements.txt
# python setup.py bdist_wheel
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-mac-x86_64
# path: dist
# macos_aarch64:
# runs-on: macos-latest-large
# if: |
# github.event_name != 'pull_request' ||
# github.event.pull_request.author_association == 'COLLABORATOR' ||
# github.event.pull_request.author_association == 'MEMBER' ||
# github.event.pull_request.user.login == 'dependabot[bot]' ||
# contains(github.event.pull_request.labels.*.name, 'safe to test')
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: '3.10'
# cache: "pip"
# - run: pip install -r requirements.txt
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: aarch64
# args: --release --out dist --find-interpreter
# sccache: 'true'
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-mac-aarch64
# path: dist
sdist:
runs-on: ubuntu-latest
if: |
github.event_name != 'pull_request' ||
github.event.pull_request.author_association == 'COLLABORATOR' ||
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.user.login == 'dependabot[bot]' ||
contains(github.event.pull_request.labels.*.name, 'safe to test')
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
release:
name: Release
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true'
runs-on: ubuntu-latest
environment: pypipublish
needs: [linux, windows, macos_x86, macos_aarch64, sdist]

Check failure on line 207 in .github/workflows/build.yml

View workflow run for this annotation

GitHub Actions / Build

Invalid workflow file

The workflow is not valid. .github/workflows/build.yml (Line: 207, Col: 20): Job 'release' depends on unknown job 'windows'. .github/workflows/build.yml (Line: 207, Col: 29): Job 'release' depends on unknown job 'macos_x86'.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
path: dist
merge-multiple: true
- name: List contents of dist directory
run: ls -la dist/
- name: Publish to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
# Uncomment to use TestPyPI
repository-url: https://test.pypi.org/legacy/
verbose: true
# Uncomment below for test runs, otherwise fails on existing packages being reuploaded
skip-existing: true