Skip to content

Upload Python Package #15

Upload Python Package

Upload Python Package #15

Workflow file for this run

name: Upload Python Package
on:
release:
types: [published]
jobs:
build:
name: Build wheels and dists
runs-on: ubuntu-latest
env:
CIBW_SKIP: "cp27-* cp34-* pp27-* cp35-*"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Build Tools
run: |
python -m pip install -U pip setuptools build
- name: Build 'wheel & sdist'
run: |
python -m build --outdir dist
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
path: dist/*
retention-days: 1
upload:
name: Publish
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}