Skip to content

Build wheels

Build wheels #22

Workflow file for this run

name: Build wheels
# By default this action does not push to test or production PyPI. The wheels
# are available as an artifact that can be downloaded and tested locally.
on:
workflow_dispatch:
inputs:
ffcx_ref:
description: "FFCx git ref to checkout"
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi"
default: false
type: boolean
workflow_call:
inputs:
ffcx_ref:
description: "FFCx git ref to checkout"
default: "main"
type: string
test_pypi_publish:
description: "Publish to Test PyPi"
default: false
type: boolean
pypi_publish:
description: "Publish to PyPi"
default: false
type: boolean
jobs:
build:
name: Build wheels and source distributions
runs-on: ubuntu-latest
steps:
- name: Checkout FFCx
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ffcx_ref }}
- name: Upgrade pip and setuptools
run: python -m pip install setuptools pip build --upgrade
- name: Build sdist and wheel
run: python -m build .
- uses: actions/upload-artifact@v4
with:
path: dist/*
upload_test_pypi:
name: Upload to test PyPI (optional)
if: ${{ github.event.inputs.test_pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/fenics-ffcx
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Push to test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
upload_pypi:
name: Upload to PyPI (optional)
if: ${{ github.event.inputs.pypi_publish == 'true' }}
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/fenics-ffcx
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Push to PyPI
uses: pypa/gh-action-pypi-publish@release/v1