Python package build and publish #90
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python package build and publish | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install twine | |
- name: Build wheels on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
# Your commands to build wheels for Ubuntu | |
# Store the output in 'dist' folder | |
- name: Build wheels on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
# Your commands to build wheels for Windows | |
# Store the output in 'dist' folder | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }} | |
path: dist/*.whl | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Download all artifacts into the same directory | |
- name: Download all artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: dist | |
- name: List files in dist | |
run: ls dist | |
- name: Set up Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.x' | |
- name: Install twine | |
run: pip install twine | |
- name: Publish wheels to Production PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.ASYNCDB_PYPI_API_TOKEN }} | |
run: twine upload dist/*.whl |