Skip to content

Commit e9385ac

Browse files
committed
Split python publishing into separate job
Signed-off-by: Pierre R. Mai <[email protected]>
1 parent 2ab8122 commit e9385ac

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

.github/workflows/protobuf.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ jobs:
2626

2727
runs-on: ubuntu-22.04
2828

29-
permissions:
30-
id-token: write
31-
3229
steps:
3330
- name: Checkout OSI
3431
uses: actions/checkout@v4
@@ -134,17 +131,12 @@ jobs:
134131
if-no-files-found: error
135132

136133
- name: Upload Python Distribution
137-
if: ${{ github.event_name == 'pull_request' }}
134+
if: ${{ github.event_name == 'pull_request' || ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) }}
138135
uses: actions/upload-artifact@v4
139136
with:
140137
name: python-dist
141138
path: dist/
142139

143-
- name: Publish Snapshot Release on TestPyPI
144-
uses: pypa/gh-action-pypi-publish@release/v1
145-
with:
146-
repository-url: https://test.pypi.org/legacy/
147-
148140
- name: Deploy to gh-pages if push to master branch
149141
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
150142
uses: peaceiris/actions-gh-pages@v3
@@ -232,3 +224,27 @@ jobs:
232224

233225
- name: Run Python Tests
234226
run: python -m unittest discover tests
227+
228+
publish-python-dist:
229+
name: Publish Python Distribution
230+
231+
runs-on: ubuntu-22.04
232+
233+
permissions:
234+
id-token: write
235+
236+
needs: [build-proto2-linux64, build-proto3-linux64]
237+
238+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
239+
240+
steps:
241+
- name: Download Distribution
242+
uses: actions/download-artifact@v4
243+
with:
244+
name: python-dist
245+
path: dist/
246+
247+
- name: Publish Snapshot Release on TestPyPI
248+
uses: pypa/gh-action-pypi-publish@release/v1
249+
with:
250+
repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)