Skip to content

Commit a314f16

Browse files
committed
chore: add build wheel workflow x 5
1 parent d8386b4 commit a314f16

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/build-wheel.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Wheel
1+
name: Build and Release Wheel
22

33
on:
44
workflow_dispatch:
@@ -7,20 +7,17 @@ on:
77
description: 'Python version to use for the build'
88
required: true
99
default: '3.10'
10-
branch:
11-
description: 'Branch to checkout'
10+
tag_name:
11+
description: 'Release tag (e.g., v0.1.0)'
1212
required: true
13-
default: 'main'
13+
default: 'v0.1.0'
1414

1515
jobs:
16-
build_wheel:
16+
build_and_release:
1717
runs-on: ubuntu-latest
18-
1918
steps:
2019
- name: Checkout repository
2120
uses: actions/checkout@v4
22-
with:
23-
ref: ${{ github.event.inputs.branch }}
2421

2522
- name: Set up Python
2623
uses: actions/setup-python@v5
@@ -42,10 +39,20 @@ jobs:
4239
whl_name=$(basename "$whl_file")
4340
echo "whl_file=$whl_file" >> $GITHUB_OUTPUT
4441
echo "whl_name=$whl_name" >> $GITHUB_OUTPUT
45-
46-
- name: Upload wheel artifact
47-
uses: actions/upload-artifact@v4
42+
43+
- name: Create and push tag
44+
run: |
45+
git config user.name "${{ github.actor }}"
46+
git config user.email "${{ github.actor }}@users.noreply.github.com"
47+
git tag ${{ github.event.inputs.tag_name }}
48+
git push origin ${{ github.event.inputs.tag_name }}
49+
50+
- name: Create GitHub Release
51+
uses: softprops/action-gh-release@v2
4852
with:
49-
name: ${{ steps.get_filename.outputs.whl_name }}
50-
path: ${{ steps.get_filename.outputs.whl_file }}
51-
if-no-files-found: error
53+
tag_name: ${{ github.event.inputs.tag_name }}
54+
name: Release ${{ github.event.inputs.tag_name }}
55+
files: ${{ steps.get_filename.outputs.whl_file }}
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+

0 commit comments

Comments
 (0)