Skip to content

Update publish.yml

Update publish.yml #90

Workflow file for this run

name: publish
on: push
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
#os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: cp3*-*
CIBW_SKIP: pp* *i686* *win32 *musllinux*
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
CIBW_BEFORE_BUILD: pip install --verbose --editable .
CIBW_ARCHS_LINUX: auto64
CIBW_ARCHS_MACOS: x86_64 universal2 arm64
CIBW_ARCHS_WINDOWS: auto64
- uses: actions/upload-artifact@v4
with:
name: artifact-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'
- run: pip install build
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: artifact-source
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: dist
pattern: artifact-*
merge-multiple: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
pip install twine
#- name: Publish
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python -m build --sdist
# twine upload dist/*
# twine upload dist/*
#- name: Test Publish
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }}
# run: |
# python -m build --sdist
# twine upload dist/*
# twine upload --repository testpypi dist/*
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_PASSWORD }}
repository-url: https://test.pypi.org/legacy/