Merge pull request #154 from trim21/feat/token_pattern #177
This file contains hidden or 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: ci | |
| on: | |
| push: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| jobs: | |
| test: | |
| name: Run tests and build distribution | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Dependencies | |
| run: | | |
| pip install tox tox-uv wheel setuptools pre-commit | |
| - name: Run lint | |
| run: >- | |
| pre-commit run -a | |
| - name: Run pylint | |
| run: >- | |
| tox -e lint | |
| - name: Run tests | |
| run: >- | |
| tox -e py | |
| build-and-publish: | |
| name: Build and optionally publish a distribution | |
| runs-on: ubuntu-latest | |
| needs: test # the test job must have been successful | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Dependencies | |
| run: | | |
| pip install wheel setuptools | |
| - name: Build distribution | |
| run: >- | |
| make dist | |
| - name: Publish distribution package to PyPI (on tags starting with v) | |
| if: startsWith(github.event.ref, 'refs/tags/v') | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
| TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ | |
| run: >- | |
| pip install twine && twine upload dist/* |