Skip to content

Commit 3d7a283

Browse files
chore(api): python trusted publisher
1 parent f62f1a4 commit 3d7a283

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
publish:
1313
name: publish
1414
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
1518

1619
steps:
1720
- uses: actions/checkout@v6
@@ -27,5 +30,3 @@ jobs:
2730
- name: Publish to PyPI
2831
run: |
2932
bash ./bin/publish-pypi
30-
env:
31-
PYPI_TOKEN: ${{ secrets.HYPERSPELL_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,3 @@ jobs:
1717
- name: Check release environment
1818
run: |
1919
bash ./bin/check-release-environment
20-
env:
21-
PYPI_TOKEN: ${{ secrets.HYPERSPELL_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 23
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-ca07e6605f61ae00e12be55df648b38e467a31d505fdeec7879c8a9ea9e1b390.yml
33
openapi_spec_hash: 25915d4fcda54adbd8a7f106d8af2d65
4-
config_hash: 4d9c48f9271d8bde9f997e7501429607
4+
config_hash: fd3005a8f140e5baadd3d25b3c9cd79f

bin/check-release-environment

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
errors=()
44

5-
if [ -z "${PYPI_TOKEN}" ]; then
6-
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
7-
fi
8-
95
lenErrors=${#errors[@]}
106

117
if [[ lenErrors -gt 0 ]]; then

bin/publish-pypi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
set -eux
44
mkdir -p dist
55
rye build --clean
6-
rye publish --yes --token=$PYPI_TOKEN
6+
if [ -n "${PYPI_TOKEN:-}" ]; then
7+
rye publish --yes --token=$PYPI_TOKEN
8+
else
9+
rye publish --yes
10+
fi

0 commit comments

Comments
 (0)