Skip to content

Commit

Permalink
and another attempt...
Browse files Browse the repository at this point in the history
  • Loading branch information
gschnabel committed Jan 22, 2024
1 parent 8652f9b commit b842abd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,24 @@ jobs:
resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
oidc_token=$(jq '.value' <<< "${resp}")
echo "oidc_token: " $oidc_token
# exchange the OIDC token for an API token
resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
api_token=$(jq '.token' <<< "${resp}")
echo "api_token: " $api_token
# mask the newly minted API token, so that we don't accidentally leak it
echo "::add-mask::${api_token}"
# 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: Publish package
env:
PYPI_USER: __token__
# PYPI_USER: __token__
PYPI_PASSWORD: ${{ steps.mint-token.outputs.api-token }}
run: |
poetry publish --username $PYPI_USER --password $PYPI_PASSWORD
echo $PYPI_PASSWORD
poetry config pypi-token.pypi $PYPI_PASSWORD
poetry publish

0 comments on commit b842abd

Please sign in to comment.