Skip to content

devops updates

devops updates #1

Workflow file for this run

name: CD
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# Many color libraries just need this to be set to any value, but at least
# one distinguishes color depth, where "3" -> "256-bit color".
FORCE_COLOR: 3
jobs:
sdist:
name: Build SDist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Run build --sdist
run: pipx run build --sdist
- name: Check metadata
run: pipx run twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest] #, macos-13, macos-latest, windows-latest]
include:
- os: macos-13
arch: x86_64
env: MACOSX_DEPLOYMENT_TARGET=13.0
- os: macos-14
arch: arm64
env: MACOSX_DEPLOYMENT_TARGET=14.0
env:
FC: gfortran-13
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
# - uses: fortran-lang/setup-fortran@v1
# with:
# compiler: gcc
# version: 12
- uses: pypa/cibuildwheel@v2.23
env:
CIBW_ENVIRONMENT: ${{ matrix.env }}
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: wheelhouse/*.whl
publish:
needs: [sdist, wheels]
name: Publish to PyPI
environment: pypi
permissions:
id-token: write
attestations: write
contents: read
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4
with:
pattern: cibw-*
merge-multiple: true
path: dist
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@v2
with:
subject-path: "dist/*"
- uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true