seperate out build and publish #8
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: | |
release: | |
types: [released] | |
branches: | |
only: | |
- master | |
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: Build | |
run: | | |
poetry config repositories.testpypi https://test.pypi.org/legacy/ | |
poetry build | |
- name: Publish to testpypi | |
run: poetry publish -r testpypi --skip-existing -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.TESTPYPI_PASSWORD}} | |
- name: Publish to pypi | |
run: poetry publish -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}} |