Skip to content

Commit

Permalink
Update publishing.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
maabuu authored Aug 12, 2023
1 parent f5d744b commit 9c352ed
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,9 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install flit
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
- name: mint API token
id: mint-token
run: |
# retrieve the ambient OIDC token
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
oidc_token=$(jq '.value' <<< "${resp}")
# exchange the OIDC token for an API token
resp=$(curl -X POST https://pypi.org/_/oidc/github/mint-token -d "{\"token\": \"${oidc_token}\"}")
api_token=$(jq '.token' <<< "${resp}")
# mask the newly minted API token, so that we don't accidentally leak it
echo "::add-mask::${api_token}"
# see the next step in the workflow for an example of using this step output
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
- name: Build and publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ steps.mint-token.outputs.api-token }}
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
flit publish

0 comments on commit 9c352ed

Please sign in to comment.