Skip to content

Commit 51627f9

Browse files
authored
chore: Add draft release workflow for versioned tags (#15)
Signed-off-by: Avishrant Sharma <avishrants@gmail.com>
1 parent d6d61c9 commit 51627f9

2 files changed

Lines changed: 83 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# SPDX-License-Identifier: GPL-3.0-or-later
2+
# Copyright (C) 2025 BeyondIRR <https://beyondirr.com/>
3+
#
4+
# This program is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation, either version 3 of the License, or
7+
# (at your option) any later version.
8+
#
9+
# This program is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
16+
17+
name: Release on Tag
18+
19+
run-name: Release ${{ github.ref_name }}
20+
21+
on:
22+
push:
23+
tags:
24+
- 'v*'
25+
26+
permissions:
27+
contents: write
28+
29+
jobs:
30+
build:
31+
name: Build with UV
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: '3.12'
41+
42+
- name: Install uv
43+
run: pip install uv
44+
45+
- name: Build wheel and source distribution
46+
run: uv build
47+
48+
- name: Upload build artifacts
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: dist-artifacts
52+
path: dist/*
53+
retention-days: 5
54+
55+
release:
56+
name: Create Release
57+
needs: build
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Checkout code
61+
uses: actions/checkout@v4
62+
63+
- name: Download build artifacts
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: dist-artifacts
67+
path: dist/
68+
69+
- name: Extract tag name
70+
id: tag
71+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
72+
73+
- name: Create Draft Release
74+
uses: softprops/action-gh-release@v2
75+
with:
76+
tag_name: ${{ steps.tag.outputs.tag }}
77+
name: Release ${{ steps.tag.outputs.tag }}
78+
draft: true
79+
files: dist/*
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-pypi.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
name: Publish release to PyPI
1818

19+
run-name: PyPI Release - ${{ github.ref_name }}
20+
1921
on:
2022
release:
2123
types: [published]

0 commit comments

Comments
 (0)