Skip to content

Release v0.21

Release v0.21 #3

Workflow file for this run

name: Create wheel and upload to PyPI
# Build when a release is published
on:
release:
types: [published]
jobs:
build_wheels:
name: Build wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'
- name: Install wheel
run: |
python -m pip install setuptools wheel numpy
- name: Build wheels
run: |
python -m pip wheel . -w wheelhouse
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/pyemir*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.11'
- name: Install build
run: |
python -m pip install build
- name: Build sdist
# This builds both the wheel and sdist
run: python -m build
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
# upload to PyPI on every tag starting with 'v'
#if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# alternatively, to publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1