Skip to content

v__0.226

v__0.226 #270

Workflow file for this run

name: builds and ships to PYPI
on: [push]
jobs:
build:
name: Build sdist & wheel on ${{ matrix.os }}
if: contains(github.event.head_commit.message, 'v__')
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build artifacts (PEP 517)
run: |
python -m pip install --upgrade pip
python -m pip install build
python -m build # creates dist/*.tar.gz and dist/*.whl
- name: Show dist
run: ls -l dist
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{ runner.os }}-${{ matrix.python-version }}
path: dist/*
publish:
name: Publish to PyPI
if: contains(github.event.head_commit.message, 'v__')
runs-on: ubuntu-latest
needs: build
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Flatten artifact structure
run: |
mkdir -p all
find dist -type f -name "*.whl" -exec cp {} all/ \;
find dist -type f -name "*.tar.gz" -exec cp {} all/ \;
ls -l all
- name: Install Twine
run: |
python -m pip install --upgrade pip
python -m pip install twine
- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload --skip-existing --verbose all/*