Skip to content

Commit 239a709

Browse files
authored
Bump Twine to 6.1 (#13510)
1 parent 8fef43c commit 239a709

File tree

2 files changed

+3
-33
lines changed

2 files changed

+3
-33
lines changed

.github/workflows/create-release.yml

+2-32
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ jobs:
4747
run: python -m build
4848

4949
- name: Check distribution
50-
run: |
51-
twine check dist/*
50+
run: twine check dist/*
5251

5352
- name: Create Sigstore attestations for built distributions
5453
uses: actions/attest@v1
@@ -87,39 +86,10 @@ jobs:
8786
name: attestation-bundles
8887
path: /tmp/attestation-bundles/
8988

90-
- name: Mint PyPI API token
91-
id: mint-token
92-
uses: actions/github-script@v7
93-
with:
94-
# language=JavaScript
95-
script: |
96-
// retrieve the ambient OIDC token
97-
const oidc_request_token = process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN;
98-
const oidc_request_url = process.env.ACTIONS_ID_TOKEN_REQUEST_URL;
99-
const oidc_resp = await fetch(`${oidc_request_url}&audience=pypi`, {
100-
headers: {Authorization: `bearer ${oidc_request_token}`},
101-
});
102-
const oidc_token = (await oidc_resp.json()).value;
103-
104-
// exchange the OIDC token for an API token
105-
const mint_resp = await fetch('https://pypi.org/_/oidc/github/mint-token', {
106-
method: 'post',
107-
body: `{"token": "${oidc_token}"}` ,
108-
headers: {'Content-Type': 'application/json'},
109-
});
110-
const api_token = (await mint_resp.json()).token;
111-
112-
// mask the newly minted API token, so that we don't accidentally leak it
113-
core.setSecret(api_token)
114-
core.setOutput('api-token', api_token)
115-
11689
- name: Upload to PyPI
11790
env:
11891
TWINE_NON_INTERACTIVE: "true"
119-
TWINE_USERNAME: "__token__"
120-
TWINE_PASSWORD: "${{ steps.mint-token.outputs.api-token }}"
121-
run: |
122-
twine upload dist/* --attestations
92+
run: twine upload dist/* --attestations
12393

12494
github-release:
12595
runs-on: ubuntu-latest

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ package = [
142142
"betterproto==2.0.0b6", # resolution fails without betterproto
143143
"build",
144144
"pypi-attestations==0.0.22",
145-
"twine>=5.1",
145+
"twine>=6.1",
146146
]
147147
test = [
148148
"pytest>=8.0",

0 commit comments

Comments
 (0)