Skip to content

Bump version to v0.9.2 #70

Bump version to v0.9.2

Bump version to v0.9.2 #70

Workflow file for this run

name: Build and Publish to PyPI
on:
push:
tags:
- 'v*' # Trigger on version tags
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine wheel
- name: Test installation (core dependencies only)
run: |
pip install -e .
python -c "import spine; print(f'SPINE version: {spine.__version__}')"
- name: Run tests
run: |
pip install pytest pytest-cov
# Install package in development mode for tests
pip install -e .
# Run basic import and utility tests that don't require external data
python -m pytest test/test_conditional_imports.py test/test_utils/ -v -x
# Skip other tests that require external data files or heavy dependencies
- name: Build packages (Python 3.9 only)
if: matrix.python-version == '3.9'
run: |
pip install build>=1.0.0
python -m build --wheel --sdist
- name: Check packages
if: matrix.python-version == '3.9'
run: |
twine check dist/*
- name: Upload build artifacts
if: matrix.python-version == '3.9'
uses: actions/upload-artifact@v4
with:
name: dist-packages
path: dist/
publish-test:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist-packages
path: dist/
- name: Publish to Test PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
pip install twine
twine upload --repository testpypi dist/*
publish-prod:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist-packages
path: dist/
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install twine
twine upload dist/*