[pre-commit.ci] pre-commit autoupdate #154
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: build | |
on: | |
push: | |
branches: | |
pull_request: | |
branches: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Install Poetry | |
run: python -m pip install poetry | |
- name: Install dependencies | |
run: poetry install | |
- name: Run tests | |
run: poetry run invoke tests | |
- name: Run linters | |
run: poetry run invoke lint --diff | |
- name: Check release | |
if: github.ref == 'refs/heads/main' | |
run: | | |
python -m pip install githubrelease | |
python -m pip install autopub | |
echo "##[set-output name=release;]$(autopub check)" | |
id: check_release | |
- name: Deploy | |
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && steps.check_release.outputs.release == '' | |
run: | | |
git checkout ${GITHUB_REF##*/} | |
git remote set-url origin https://$GITHUB_TOKEN@github.com/${GITHUB_REPOSITORY} | |
autopub prepare | |
poetry build | |
autopub commit | |
autopub githubrelease | |
poetry publish -u __token__ -p $PYPI_PASSWORD | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |