Skip to content

Commit

Permalink
Update release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesloibl committed Nov 28, 2023
1 parent 326e192 commit b1e33a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ jobs:
run: pyproject-build -s -w . -o dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
packages-dir: dist/
skip-existing: true
verbose: true
print-hash: true
9 changes: 1 addition & 8 deletions tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from __future__ import annotations

from pathlib import Path
from subprocess import check_call

from git import Commit, Head, Remote, Repo, TagReference
from packaging.version import Version
Expand All @@ -19,7 +18,7 @@ def main(version_str: str) -> None:
raise RuntimeError(msg)
upstream, release_branch = create_release_branch(repo, version)
try:
release_commit = release_changelog(repo, version)
release_commit = repo.head.commit
tag = tag_release_commit(release_commit, repo, version)
print("push release commit")
repo.git.push(upstream.name, f"{release_branch}:main", "-f")
Expand Down Expand Up @@ -54,12 +53,6 @@ def get_upstream(repo: Repo) -> Remote:
raise RuntimeError(msg)


def release_changelog(repo: Repo, version: Version) -> Commit:
print("generate release commit")
check_call(["towncrier", "build", "--yes", "--version", version.public], cwd=str(ROOT_SRC_DIR))
return repo.index.commit(f"release {version}", skip_hooks=True)


def tag_release_commit(release_commit: Commit, repo: Repo, version: Version) -> TagReference:
print("tag release commit")
existing_tags = [x.name for x in repo.tags]
Expand Down

0 comments on commit b1e33a3

Please sign in to comment.