Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-hatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ jobs:
path: installers
merge-multiple: true

- name: Add assets to current release
- name: Add assets to draft release
uses: softprops/action-gh-release@v2
with:
files: |-
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/build-hatchling.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
Expand All @@ -55,3 +56,8 @@ jobs:
uses: pypa/gh-action-pypi-publish@v1.12.3
with:
skip-existing: true

- name: Add assets to draft release
uses: softprops/action-gh-release@v2
with:
files: dist/*
20 changes: 17 additions & 3 deletions scripts/release_github.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import argparse
import subprocess
import sys
import webbrowser
from urllib.parse import urlencode

Expand All @@ -11,17 +13,29 @@ def main():
args = parser.parse_args()

version, notes = get_latest_release(args.project)

tag = f"{args.project}-v{version}"

# Create and push tag first
try:
subprocess.run(["git", "tag", tag], check=True)
subprocess.run(["git", "push", "origin", tag], check=True)
print(f"Created and pushed tag: {tag}")
except subprocess.CalledProcessError as e:
print(f"Error creating tag: {e}")
sys.exit(1)

# Open GitHub UI to create draft release
params = urlencode({
"title": f"{args.project.capitalize()} v{version}",
"tag": f"{args.project}-v{version}",
"tag": tag,
"body": notes,
"prerelease": "true",
"draft": "true",
})

url = f"https://github.com/pypa/hatch/releases/new?{params}"
webbrowser.open_new_tab(url)



if __name__ == "__main__":
main()
Loading