Merge pull request #13 from chriscarrollsmith/dependabot/pip/pip-b679… #4
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-test-publish | |
on: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1 | |
- name: Build and install project | |
run: | | |
poetry build | |
poetry install | |
- name: Run tests with pytest | |
run: | | |
poetry run pytest tests | |
- name: Publish to PyPi | |
env: | |
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
if ! poetry publish --build -u __token__ -p $PYPI_TOKEN; then | |
echo "::warning::Version has not been incremented. No new version published." | |
fi |