Skip to content

Commit 28cc153

Browse files
committed
feat: add GitHub Actions workflow for draft release
This commit introduces a new GitHub Actions workflow that automates the process of creating draft releases when tags are pushed. The workflow includes steps for checking out the code, retrieving tag information, setting up Python, building the package, and creating the draft release with generated release notes.
1 parent 943c228 commit 28cc153

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Create Draft Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Build & Create Draft Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Get tag info
23+
id: tag_info
24+
run: |
25+
TAG_NAME=${GITHUB_REF#refs/tags/}
26+
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
27+
echo "version=${TAG_NAME#v}" >> $GITHUB_OUTPUT
28+
29+
- name: Setup Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.12'
33+
cache: 'pip'
34+
35+
- name: Build package
36+
run: |
37+
python -m pip install --upgrade pip build
38+
python -m build
39+
40+
- name: Create Draft Release
41+
uses: softprops/action-gh-release@v2
42+
with:
43+
tag_name: ${{ steps.tag_info.outputs.tag_name }}
44+
name: Release ${{ steps.tag_info.outputs.tag_name }}
45+
draft: true
46+
prerelease: false
47+
generate_release_notes: true
48+
files: |
49+
dist/*.whl
50+
dist/*.tar.gz

0 commit comments

Comments
 (0)