Skip to content

Commit

Permalink
moving to trusted publishing for pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Dec 31, 2023
1 parent 6159910 commit e339d27
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
name: manylinux-wheels
path: wheelhouse

###################
# testing wheels
###################
test-wheels:
needs: [build-manylinux-wheels]
runs-on: ubuntu-latest
Expand Down Expand Up @@ -126,10 +129,15 @@ jobs:
path: texttesttmp.zip
if-no-files-found: warn

###################
# publishing wheels
###################
publish-wheels:
if: github.repository == 'eclipse-sumo/sumo' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags'))
needs: [test-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Downloading Wheels artifact
Expand All @@ -138,14 +146,12 @@ jobs:
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
packages-dir: manylinux-wheels/
repository-url: https://test.pypi.org/legacy/
skip-existing: true
packages-dir: manylinux-wheels/

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: manylinux-wheels/
12 changes: 9 additions & 3 deletions .github/workflows/wheel-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
name: python-wheels
path: dist

###################
# testing wheels
###################
test-wheels:
needs: [build-wheels]
strategy:
Expand Down Expand Up @@ -152,25 +155,28 @@ jobs:
path: texttesttmp.zip
if-no-files-found: warn

###################
# publishing wheels
###################
publish-wheels:
if: github.repository == 'eclipse-sumo/sumo' && (github.event_name == 'schedule' || startsWith(github.ref, 'refs/tags'))
needs: [test-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v3

- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
packages-dir: python-wheels/
repository-url: https://test.pypi.org/legacy/
skip-existing: true
packages-dir: python-wheels/

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
packages-dir: python-wheels/
5 changes: 2 additions & 3 deletions .github/workflows/wheel-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ jobs:
if: github.repository == 'eclipse-sumo/sumo' && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || startsWith(github.ref, 'refs/tags'))
needs: [test-wheels]
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- uses: actions/download-artifact@v3
Expand All @@ -206,12 +208,9 @@ jobs:
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
skip-existing: true

- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}

0 comments on commit e339d27

Please sign in to comment.