Skip to content

v0.8.0

v0.8.0 #55

Workflow file for this run

name: release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-wheels:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
os: ["ubuntu-latest", "windows-latest", "macos-latest", "macos-13"] # macOS 13 is the latest version with the old architecture
name: Build for ${{ matrix.os }} on Python ${{ matrix.python-version }}
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
- name: Setup FFMPEG
uses: FedericoCarboni/setup-ffmpeg@v3
if: ${{ ! startsWith(matrix.os, 'macos') }}
- name: Setup Dependencies with Homebrew
if: startsWith(matrix.os, 'macos')
run: |
brew install llvm ffmpeg
echo "CC=$(brew --prefix)/opt/llvm/bin/clang" >> $GITHUB_ENV
echo "CXX=$(brew --prefix)/opt/llvm/bin/clang++" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
# Full clone for version calculation
fetch-depth: 0
- name: Build Project
run: make build-wheel
- uses: actions/upload-artifact@v4
with:
name: package-wheels-${{ matrix.os }}-${{ matrix.python-version }}
path: dist/*
build-sdist:
runs-on: ubuntu-latest
name: Build sdist
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
- uses: actions/checkout@v4
with:
# Full clone for version calculation
fetch-depth: 0
- name: Build Project
run: make build-sdist
- uses: actions/upload-artifact@v4
with:
name: package-sdist
path: dist/*
publish:
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'thorn-oss' && github.event_name == 'release' }}
steps:
- uses: actions/checkout@v4
with:
# Full clone for version calculation
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Setup Poetry
uses: abatilo/actions-poetry@v3
- name: Setup Dynamic Versioning
run: poetry self add "poetry-dynamic-versioning[plugin]"
- name: Download wheels
uses: actions/download-artifact@v4
with:
path: dist
pattern: package-*
merge-multiple: true
- name: Load PyPI Token
uses: 1password/load-secrets-action@v2
with:
# Export loaded secrets as environment variables
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
POETRY_PYPI_TOKEN_PYPI: op://data-science-oss/perception-pypi-api-key/secret/value
- name: Publish package
run: poetry publish -n