This repository has been archived by the owner on Feb 10, 2024. It is now read-only.
Update package init #7
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: Build | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, 3.11] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Upgrade Pip | |
run: pip install --upgrade pip | |
- name: Install dependencies | |
run: pip install --no-cache-dir -r requirements.txt | |
- name: Install build module | |
run: pip install --no-cache-dir build | |
- name: Run tests | |
run: pytest tests | |
- name: Build package | |
run: python -m build | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install twine & wheel | |
run: pip install --no-cache-dir twine wheel | |
- name: Create Distribution Package | |
run: python setup.py sdist bdist_wheel | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python -m twine upload --skip-existing dist/* |