Skip to content

test pypi

test pypi #3

Workflow file for this run

name: Build, Test & Publish
on:
workflow_dispatch:
push:
branches:
- master
jobs:
# Job 1: Build & Test with Pip
build_and_test:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest, ubuntu-18.04, ubuntu-20.04]
python-version: ["3.6", "3.8", "3.9", "3.10", "3.11" , "3.x"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and package
run: |
python -m pip install pytest
pip install --verbose .
- name: Run tests
run: python -m pytest
# Job 2: Build SDist & Wheels and Publish to TestPyPI
publish:
needs: build_and_test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest, ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
- name: Build SDist & Wheels
run: |
pip install build
python -m build
- name: Check metadata
run: |
pip install twine
twine check dist/*
# - name: Publish to TestPyPI
# if: github.ref == 'refs/heads/master' # Only if on master branch
# run: |
# pip install twine
# twine upload --repository testpypi dist/* --skip-existing
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}