Skip to content

Commit

Permalink
Split python publishing into separate job
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre R. Mai <[email protected]>
  • Loading branch information
pmai committed Apr 5, 2024
1 parent 2ab8122 commit e9385ac
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ jobs:

runs-on: ubuntu-22.04

permissions:
id-token: write

steps:
- name: Checkout OSI
uses: actions/checkout@v4
Expand Down Expand Up @@ -134,17 +131,12 @@ jobs:
if-no-files-found: error

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

- name: Publish Snapshot Release on TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Deploy to gh-pages if push to master branch
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: peaceiris/actions-gh-pages@v3
Expand Down Expand Up @@ -232,3 +224,27 @@ jobs:

- name: Run Python Tests
run: python -m unittest discover tests

publish-python-dist:
name: Publish Python Distribution

runs-on: ubuntu-22.04

permissions:
id-token: write

needs: [build-proto2-linux64, build-proto3-linux64]

if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}

steps:
- name: Download Distribution
uses: actions/download-artifact@v4
with:
name: python-dist
path: dist/

- name: Publish Snapshot Release on TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

0 comments on commit e9385ac

Please sign in to comment.