Skip to content

Commit 277a0b2

Browse files
update
1 parent 4282433 commit 277a0b2

File tree

1 file changed

+5
-36
lines changed

1 file changed

+5
-36
lines changed

.github/actions/hatch-release-pypi/action.yml

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -101,43 +101,12 @@ runs:
101101
shell: bash
102102
run: hatch build
103103

104-
# Publish using Trusted Publishing - manual approach for composite action compatibility
104+
# Publish using Trusted Publishing - no password required
105105
# See: https://docs.pypi.org/trusted-publishers/using-a-publisher/
106-
- name: Mint PyPI API token via OIDC
107-
id: mint-token
108-
shell: bash
109-
run: |
110-
# Retrieve the ambient OIDC token
111-
resp=$(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
112-
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=pypi")
113-
oidc_token=$(jq -r '.value' <<< "${resp}")
114-
115-
if [ -z "$oidc_token" ] || [ "$oidc_token" = "null" ]; then
116-
echo "::error::Failed to retrieve OIDC token"
117-
exit 1
118-
fi
119-
120-
# Exchange the OIDC token for a PyPI API token
121-
resp=$(curl -sS -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\": \"${oidc_token}\"}")
122-
api_token=$(jq -r '.token' <<< "${resp}")
123-
124-
if [ -z "$api_token" ] || [ "$api_token" = "null" ]; then
125-
echo "::error::Failed to mint PyPI API token. Response: $resp"
126-
exit 1
127-
fi
128-
129-
# Mask the token to prevent leaking
130-
echo "::add-mask::${api_token}"
131-
echo "api-token=${api_token}" >> "${GITHUB_OUTPUT}"
132-
133106
- name: Publish package distributions to PyPI
134-
shell: bash
135-
env:
136-
TWINE_USERNAME: __token__
137-
TWINE_PASSWORD: ${{ steps.mint-token.outputs.api-token }}
138-
run: |
139-
pip install --quiet twine
140-
twine upload --verbose dist/*
107+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
108+
with:
109+
verbose: true
141110

142111
- name: Push version bump commit to main
143112
if: ${{ env.SKIP_BUMP == '0' }}
@@ -159,7 +128,7 @@ runs:
159128
- name: Generate Release Notes
160129
id: generate_release_notes
161130
continue-on-error: true
162-
uses: SolaceDev/solace-public-workflows/generate-github-release-notes@main
131+
uses: solacedev/solace-public-workflows/generate-github-release-notes@main
163132
with:
164133
from-ref: ${{ env.CURRENT_VERSION }}
165134
to-ref: ${{ env.NEW_VERSION }}

0 commit comments

Comments
 (0)