File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 99 release :
1010 if : github.repository == 'python-gitlab/python-gitlab'
1111 runs-on : ubuntu-latest
12+ permissions :
13+ id-token : write
14+ environment : pypi.org
1215 steps :
1316 - uses : actions/checkout@v3.5.0
1417 with :
1518 fetch-depth : 0
1619 token : ${{ secrets.RELEASE_GITHUB_TOKEN }}
20+ - name : mint API token
21+ id : mint-token
22+ run : |
23+ resp=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
24+ oidc_token=$(jq '.value' <<< "${resp}")
25+
26+ resp=$(curl -X POST https://pypi.org/_/oidc/github/mint-token -d "{\"token\":${oidc_token}}")
27+ api_token=$(jq '.token' <<< "${resp}" | tr -d '"')
28+
29+ echo "::add-mask::${api_token}"
30+ echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
1731 - name : Python Semantic Release
1832 uses : relekang/python-semantic-release@v7.33.2
1933 with :
2034 github_token : ${{ secrets.RELEASE_GITHUB_TOKEN }}
21- pypi_token : ${{ secrets.PYPI_TOKEN }}
35+ pypi_token : ${{ steps.mint-token.outputs.api-token }}
Original file line number Diff line number Diff line change @@ -7,3 +7,5 @@ pytest-github-actions-annotate-failures==0.1.8
77pytest==7.2.2
88PyYaml==5.4.1
99responses==0.23.1
10+ setuptools==67.7.2
11+ wheel==0.40.0
You can’t perform that action at this time.
0 commit comments