|
62 | 62 | test "$GITHUB_EVENT_NAME" = workflow_dispatch |
63 | 63 | test "$GITHUB_REF" = refs/heads/main |
64 | 64 | test "$RELEASE_TAG" = v4.20.0 |
65 | | - docker info --format '{{.ServerVersion}}' |
| 65 | + test -n "${ACTIONS_ID_TOKEN_REQUEST_URL:-}" |
| 66 | + test -n "${ACTIONS_ID_TOKEN_REQUEST_TOKEN:-}" |
66 | 67 |
|
67 | 68 | - name: Checkout the release tag, or main for a first publish |
68 | 69 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
@@ -170,11 +171,26 @@ jobs: |
170 | 171 | sha256sum dist/* |
171 | 172 |
|
172 | 173 | - name: Publish to PyPI |
173 | | - if: ${{ github.event_name == 'release' || !inputs.dry_run }} |
| 174 | + if: ${{ !inputs.manual_self_hosted && (github.event_name == 'release' || !inputs.dry_run) }} |
174 | 175 | uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |
175 | 176 | with: |
176 | 177 | packages-dir: packages/pypi-cli/dist |
177 | 178 |
|
| 179 | + # The reviewed self-hosted runner has no Docker, so the container action above |
| 180 | + # cannot start there. Twine 6.2 obtains the same short-lived PyPI credential |
| 181 | + # directly from this job's OIDC identity; no stored API token is needed. |
| 182 | + - name: Publish to PyPI from the recovery runner |
| 183 | + if: ${{ inputs.manual_self_hosted && !inputs.dry_run }} |
| 184 | + shell: bash |
| 185 | + working-directory: packages/pypi-cli |
| 186 | + run: | |
| 187 | + set -Eeuo pipefail |
| 188 | + unset TWINE_USERNAME TWINE_PASSWORD |
| 189 | + mkdir -p "$RUNNER_TEMP/twine-home" |
| 190 | + HOME="$RUNNER_TEMP/twine-home" \ |
| 191 | + PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring \ |
| 192 | + python -m twine upload --non-interactive dist/* |
| 193 | +
|
178 | 194 | - name: Dry run summary |
179 | 195 | if: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} |
180 | 196 | shell: bash |
|
0 commit comments