Skip to content

Commit 327abca

Browse files
committed
Chore GH Actions workflows to use release event and enable asset uploads
1 parent aa90fc6 commit 327abca

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

.github/workflows/publish-pre-release.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
name: Publish RF-DETR Pre-Releases to PyPI
22

33
on:
4-
push:
5-
tags:
6-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+[0-9]+a[0-9]"
7-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+[0-9]+b[0-9]"
8-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+[0-9]+rc[0-9]"
9-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+a[0-9]"
10-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+b[0-9]"
11-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+rc[0-9]"
12-
- "[0-9]+.[0-9]+.[0-9]+a[0-9]"
13-
- "[0-9]+.[0-9]+.[0-9]+b[0-9]"
14-
- "[0-9]+.[0-9]+.[0-9]+rc[0-9]"
4+
release:
5+
types: [published]
156
workflow_dispatch:
167
pull_request:
178
branches: [main, develop]
@@ -20,7 +11,7 @@ on:
2011
- '.github/workflows/publish-pre-release.yml'
2112

2213
permissions:
23-
contents: read
14+
contents: write # Required for uploading assets to release
2415

2516
jobs:
2617
build-pkg:
@@ -50,3 +41,10 @@ jobs:
5041
uses: pypa/[email protected]
5142
with:
5243
attestations: true
44+
45+
- name: 📤 Upload assets to GitHub Release
46+
if: github.event_name == 'release'
47+
uses: AButler/[email protected]
48+
with:
49+
files: 'dist/*'
50+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/publish-release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
name: Publish RF-DETR Releases to PyPI
22

33
on:
4-
push:
5-
tags:
6-
- "[0-9]+.[0-9]+[0-9]+.[0-9]+[0-9]"
7-
- "[0-9]+.[0-9]+[0-9]+.[0-9]"
8-
- "[0-9]+.[0-9]+.[0-9]"
4+
release:
5+
types: [published]
96
workflow_dispatch:
107
pull_request:
118
branches: [main, develop]
@@ -14,7 +11,7 @@ on:
1411
- '.github/workflows/publish-release.yml'
1512

1613
permissions:
17-
contents: read
14+
contents: write # Required for uploading assets to release
1815

1916
jobs:
2017
build-pkg:
@@ -39,6 +36,13 @@ jobs:
3936
- name: Display distribution files
4037
run: ls -lh dist/
4138

39+
- name: 📤 Upload assets to GitHub Release
40+
if: github.event_name == 'release'
41+
uses: AButler/[email protected]
42+
with:
43+
files: 'dist/*'
44+
repo-token: ${{ secrets.GITHUB_TOKEN }}
45+
4246
- name: 🚀 Publish to PyPi
4347
if: github.event_name != 'pull_request'
4448
uses: pypa/[email protected]

0 commit comments

Comments
 (0)