poetry test and publish in release c #5
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: Release CICD | ||
on: | ||
branches: | ||
only: | ||
- master | ||
release: | ||
types: [released] | ||
jobs: | ||
build: | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
python-version: ['3.9','3.10'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{matrix.python-version}} | ||
- name: Pip install package | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install . | ||
- name: Poetry install package | ||
run: | | ||
pip install poetry | ||
poetry install | ||
- name: Linting | ||
run: | | ||
poetry run pydocstyle --convention=google | ||
poetry run isort . --check | ||
poetry run black . --check | ||
poetry run flake8 . --ignore E501,F401,W503 --count | ||
continue-on-error: True | ||
- name: Testing | ||
run: | | ||
poetry run pytest | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Install poetry | ||
run: pip install poetry | ||
- name: Test build and publish | ||
run: | | ||
poetry config repositories.testpypi https://test.pypi.org/legacy/ | ||
poetry publish --build -r testpypi --skip-existing -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.TESTPYPI_PASSWORD}} | ||
- name: Build and publish | ||
run: poetry publish --build -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}} |