diff --git a/README.md b/README.md index 5ce7a61..7c9116f 100644 --- a/README.md +++ b/README.md @@ -16,16 +16,41 @@ GitHub Actions for Python projects using poetry ### Create `main.workflow` ```hcl -workflow "Python workflow" { +workflow "Publish Python package" { on = "push" resolves = ["publish"] } +action "Install" { + uses = "abatilo/actions-poetry@3.7.3" + args = ["install"] +} + +action "Run black" { + needs = "Install" + uses = "abatilo/actions-poetry@3.7.3" + args = ["run", "python", "-m", "black", "--check", "."] +} + +action "Run pylint" { + needs = "Install" + uses = "abatilo/actions-poetry@3.7.3" + args = ["run", "python", "-m", "pylint", "src"] +} + +action "Master branch" { + needs = ["Run pylint", "Run black"] + uses = "actions/bin/filter@master" + args = "branch master" +} + action "publish" { - needs = "poetry-build" + needs = "Master branch" uses = "abatilo/actions-poetry@3.7.3" + secrets = ["PYPI_USERNAME", "PYPI_PASSWORD"] args = ["publish", "--build", "--no-interaction", "-vv", "--username", "$PYPI_USERNAME", "--password", "$PYPI_PASSWORD"] } + ``` ## License