Skip to content

Commit 6902aeb

Browse files
committed
add GHA job for publishing GitHub releases
1 parent 52a0102 commit 6902aeb

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
permissions:
1313
id-token: write
14-
contents: read
14+
contents: write
1515

1616
jobs:
1717
build:
@@ -67,8 +67,34 @@ jobs:
6767
6868
- name: Publish Python package
6969
if: >
70-
github.event_name != 'pull_request' && (
71-
startsWith(github.ref, 'refs/tags/') ||
72-
(github.ref == 'refs/heads/main' && steps.changes.outputs.publish == 'true')
73-
)
70+
startsWith(github.ref, 'refs/tags/')
71+
|| (github.event_name != 'pull_request' &&
72+
github.ref == 'refs/heads/main' &&
73+
steps.changes.outputs.publish == 'true')
7474
run: uv publish
75+
76+
release:
77+
name: Publish GitHub Release
78+
runs-on: ubuntu-latest
79+
needs: build
80+
if: startsWith(github.ref, 'refs/tags/')
81+
82+
steps:
83+
- name: Download artifacts
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: dist
87+
path: dist
88+
89+
- name: Create/Update GitHub Release
90+
uses: softprops/action-gh-release@v2
91+
env:
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
with:
94+
name: ${{ github.ref_name }}
95+
tag_name: ${{ github.ref_name }}
96+
files: dist/*.whl
97+
generate_release_notes: true
98+
preserve_order: true
99+
overwrite_files: true
100+
fail_on_unmatched_files: true

0 commit comments

Comments
 (0)