Skip to content

Commit

Permalink
Add release workflow on github release creation (#71)
Browse files Browse the repository at this point in the history
* Add release workflow on github release creation

* Run on 'published' instead of 'created'

* Use poetry and tweak publish task
  • Loading branch information
eugenetriguba committed Nov 22, 2023
1 parent 75e73e2 commit 2721c52
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Python Package

on:
release:
types:
- published

jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install dependencies
run: pip install setuptools==68.2.2 wheel==0.41.3 poetry==1.7.1
- name: Build and publish
run: |
poetry build
poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ lint = { cmd = "./task lint_pylint && ./task lint_mypy", help = "lint project wi
lint_pylint = "pylint tests taskipy"
lint_mypy = "mypy tests taskipy"

publish = { cmd = "poetry publish --build", help = "publishes taskipy to PyPI as is. do not use directly" }
post_publish = "./task make_release_commit"

make_release_commit = { cmd = "python ./.hooks/make_release_commit.py", help = "creates a tagged commit for the release. do not use directly" }

pre_publish_patch = "./task test"
publish_patch = { cmd = "poetry version patch && ./task publish", help = "publishes a patch version, that has only fixes but no new features (x.x.PATCH)" }
publish_patch = { cmd = "poetry version patch && ./task make_release_commit", help = "publishes a patch version, that has only fixes but no new features (x.x.PATCH)" }

pre_publish_minor = "./task test"
publish_minor = { cmd = "poetry version minor && ./task publish", help = "publishes a minor version, which has new fetures (x.MINOR.x)" }
publish_minor = { cmd = "poetry version minor && ./task make_release_commit", help = "publishes a minor version, which has new features (x.MINOR.x)" }

[build-system]
requires = ["poetry>=0.12"]
Expand Down

0 comments on commit 2721c52

Please sign in to comment.