Merge pull request #39 from ShaunD137/animation-generation #57
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/publish package | |
on: push | |
jobs: | |
build_wheels: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
name: Build wheels on ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: "recursive" | |
- name: Setup uv | |
id: setup-uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Print the installed version | |
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" | |
- name: Set up Python 3.12 and install dependencies | |
run: | | |
uv python install 3.12 | |
uv sync --python 3.12 --extra test --extra build --frozen | |
- name: Build | |
uses: pypa/[email protected] | |
env: | |
CIBW_ARCHS_LINUX: auto | |
CIBW_ARCHS_MACOS: x86_64 arm64 | |
- name: Upload Wheels | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-${{ matrix.os }} | |
path: wheelhouse | |
make_sdist: | |
name: Make SDist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build SDist | |
run: pipx run build --sdist | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist-src | |
path: dist/*.tar.gz | |
publish-to-pypi: | |
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | |
needs: [build_wheels, make_sdist] | |
runs-on: ubuntu-latest | |
environment: | |
name: release | |
url: https://pypi.org/p/sdf-xarray | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download distribution packages | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
path: dist/ | |
merge-multiple: true | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |