Skip to content

Commit

Permalink
Switch to trusted pypi upload, rather than token
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Jun 10, 2024
1 parent a43a46f commit 884aca1
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- uses: actions/upload-artifact@v5
with:
name: linux-wheels
name: whl-linux
path: ./wheelhouse/*.whl

build_musl_wheels:
Expand All @@ -48,7 +48,7 @@ jobs:

- uses: actions/upload-artifact@v5
with:
name: musl-wheels
name: whl-musl
path: ./wheelhouse/*.whl

build_macosx_intel_wheels:
Expand All @@ -69,7 +69,7 @@ jobs:

- uses: actions/upload-artifact@v5
with:
name: macos-wheels
name: whl-macos
path: ./wheelhouse/*.whl

build_macosx_arm_wheels:
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:
- uses: actions/upload-artifact@v5
with:
name: arm-wheels
name: whl-arm
path: ./wheelhouse/*.whl

build_sdist:
Expand All @@ -106,6 +106,12 @@ jobs:
# Just need to build sdist on a single machine
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/GalSim
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v4

Expand All @@ -123,9 +129,11 @@ jobs:
pip install -U -r requirements.txt
- name: Download wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: ./wheels
pattern: whl-*
merge-multiple: true

- name: Build sdist
run: |
Expand All @@ -137,15 +145,11 @@ jobs:
run: |
echo ls -l wheels
ls -l wheels
echo ls -l wheels/*
ls -l wheels/*
cp wheels/*/*.whl dist
cp wheels/*.whl dist
echo ls -l dist
ls -l dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
verbose: true

0 comments on commit 884aca1

Please sign in to comment.