fix: fixing semantic release config #80
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: CI | |
on: [push, pull_request] | |
jobs: | |
lint_test_and_build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: flake8 linting | |
run: poetry run flake8 . | |
- name: black code formatting | |
run: poetry run black . --check | |
- name: mypy type checking | |
run: poetry run mypy . | |
- name: pytest | |
run: poetry run pytest --cov=./ --cov-report=xml | |
- name: build | |
run: poetry build | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
release: | |
needs: lint_test_and_build | |
permissions: | |
contents: write | |
id-token: write | |
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482 | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') | |
runs-on: ubuntu-latest | |
concurrency: release | |
environment: | |
name: pypi | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Semantic Release | |
id: release | |
uses: python-semantic-release/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
if: steps.release.outputs.released == 'true' | |
- name: Publish package distributions to GitHub Releases | |
uses: python-semantic-release/upload-to-gh-release@main | |
if: steps.release.outputs.released == 'true' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |