Skip to content

maybe AI can fix this #8

maybe AI can fix this

maybe AI can fix this #8

Workflow file for this run

name: Python Wheels
on:
push:
tags: ['v*']
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Zig
uses: mlugg/setup-zig@v2
with:
version: master
- name: Set version from tag (Unix)
if: runner.os != 'Windows'
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "__version__ = \"$VERSION\"" > python/astroz/__version__.py
- name: Set version from tag (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$version = "$env:GITHUB_REF" -replace "refs/tags/v", ""
Set-Content -Path "python/astroz/__version__.py" -Value "__version__ = `"$version`""
- name: Build wheels
uses: pypa/cibuildwheel@v2.22.0
with:
package-dir: python
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version from tag
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "__version__ = \"$VERSION\"" > python/astroz/__version__.py
- name: Build sdist
run: |
cd python
pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: python/dist/*.tar.gz
publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1