Merge pull request #13 from Datateer/inc-23454 #26
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
# Quality: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - uses: actions/setup-python@v2 | |
# with: | |
# python-version: 3.8 | |
# - name: Install Python Poetry | |
# uses: abatilo/[email protected] | |
# with: | |
# poetry-version: 1.4.1 | |
# - name: Configure poetry | |
# shell: bash | |
# run: python -m poetry config virtualenvs.in-project true | |
# - name: View poetry version | |
# run: poetry --version | |
# - name: Install dependencies | |
# run: | | |
# python -m poetry install | |
# # - name: Lint with flake8 | |
# # run: | | |
# # # stop the build if there are Python syntax errors or undefined names | |
# # poetry -vvv run flake8 . --count --show-source --statistics --max-line-length=120 --max-complexity=10 | |
# # TODO: | |
# - name: Test with pytest | |
# run: | | |
# poetry run coverage run -m pytest && poetry run coverage report -m --fail-under=90 | |
BumpVersion: | |
# needs: Quality | |
# 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' | |
concurrency: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Python Semantic Release | |
uses: relekang/python-semantic-release@master | |
with: | |
# a special token in github at the organization account level | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
Publish: | |
needs: BumpVersion | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
name: Upload release to PyPI | |
runs-on: ubuntu-latest | |
environment: pypi | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Build distributable package | |
run: | | |
pip install poetry | |
poetry build | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |