Skip to content

Commit

Permalink
Merge branch 'main' of github.com:radumarias/rencrypt-python
Browse files Browse the repository at this point in the history
  • Loading branch information
radumarias committed Jun 1, 2024
2 parents d80bc89 + c09c7b2 commit a778228
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,27 @@ jobs:
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4
- 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 -r '.value' <<< "${resp}")
# 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 -r '.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: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_PYPI_TOKEN: ${{ steps.mint-token.outputs.api-token }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*

0 comments on commit a778228

Please sign in to comment.