Add build and publish steps to CI

This commit is contained in:
Luke Tainton 2022-06-25 21:38:29 +01:00
parent 460e74c6bb
commit 7d9f745930
No known key found for this signature in database
GPG Key ID: ABEE10849773E353

View File

@ -79,3 +79,36 @@ jobs:
run: coverage run -m py.test -v
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
build:
needs:
- skip_duplicate
- lint
- test
if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }}
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.10
# - name: Install dependencies
# run: pip install -r requirements.txt && pip install -r requirements-dev.txt
- name: Install build dependencies
run: pip install setuptools wheel
- name: Build wheel file
run: python setup.py bdist_wheel
- id: skip_check
uses: actions/upload-artifact@v3
with:
name: whl
path: dist/
publish:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}