Build wheels #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
ufl_ref: | |
description: "UFL git ref to checkout" | |
default: "main" | |
type: string | |
test_pypi_publish: | |
description: "Publish to Test PyPi (true | false)" | |
default: false | |
type: boolean | |
pypi_publish: | |
description: "Publish to PyPi (true | false)" | |
default: false | |
type: boolean | |
workflow_call: | |
inputs: | |
ufl_ref: | |
description: "UFL git ref to checkout" | |
default: "main" | |
type: string | |
test_pypi_publish: | |
description: "Publish to Test PyPi (true | false)" | |
default: false | |
type: boolean | |
pypi_publish: | |
description: "Publish to PyPi (true | false))" | |
default: false | |
type: boolean | |
jobs: | |
build: | |
name: Build wheels and source distributions | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout UFL | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.ufl_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_pypi: | |
name: Upload to PyPI (optional) | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Push to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ github.event.inputs.pypi_publish == 'true' }} | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
repository_url: https://upload.pypi.org/legacy/ | |
- name: Push to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: ${{ github.event.inputs.test_pypi_publish == 'true' }} | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TEST_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ |