2019-08-20 16:48:52 -04:00
|
|
|
---
|
|
|
|
name: pypi-publish
|
|
|
|
description: Upload Python distribution packages to PyPI
|
|
|
|
inputs:
|
|
|
|
user:
|
|
|
|
description: PyPI user
|
|
|
|
required: false
|
|
|
|
default: __token__
|
|
|
|
password:
|
|
|
|
description: Password for your PyPI user or an access token
|
2023-04-27 11:30:43 -04:00
|
|
|
required: false
|
2023-03-10 19:18:41 -05:00
|
|
|
repository-url: # Canonical alias for `repository_url`
|
2019-08-20 16:48:52 -04:00
|
|
|
description: The repository URL to use
|
|
|
|
required: false
|
2023-03-10 19:18:41 -05:00
|
|
|
repository_url: # DEPRECATED ALIAS; TODO: Remove in v3+
|
|
|
|
description: >-
|
|
|
|
[DEPRECATED]
|
|
|
|
The repository URL to use
|
|
|
|
deprecationMessage: >-
|
|
|
|
The inputs have been normalized to use kebab-case.
|
|
|
|
Use `repository-url` instead.
|
|
|
|
required: false
|
2023-03-16 04:39:57 -04:00
|
|
|
default: https://upload.pypi.org/legacy/
|
2023-03-10 19:18:41 -05:00
|
|
|
packages-dir: # Canonical alias for `packages_dir`
|
2019-12-05 18:25:02 -05:00
|
|
|
description: The target directory for distribution
|
|
|
|
required: false
|
2023-03-10 21:06:39 -05:00
|
|
|
# default: dist # TODO: uncomment once alias removed
|
2023-03-10 19:18:41 -05:00
|
|
|
packages_dir: # DEPRECATED ALIAS; TODO: Remove in v3+
|
|
|
|
description: >-
|
|
|
|
[DEPRECATED]
|
|
|
|
The target directory for distribution
|
|
|
|
deprecationMessage: >-
|
|
|
|
The inputs have been normalized to use kebab-case.
|
|
|
|
Use `packages-dir` instead.
|
|
|
|
required: false
|
|
|
|
default: dist
|
|
|
|
verify-metadata: # Canonical alias for `verify_metadata`
|
2020-06-03 11:04:52 -04:00
|
|
|
description: Check metadata before uploading
|
2020-06-02 11:08:43 -04:00
|
|
|
required: false
|
2023-03-10 21:06:39 -05:00
|
|
|
# default: 'true' # TODO: uncomment once alias removed
|
2023-03-10 19:18:41 -05:00
|
|
|
verify_metadata: # DEPRECATED ALIAS; TODO: Remove in v3+
|
|
|
|
description: >-
|
|
|
|
[DEPRECATED]
|
|
|
|
Check metadata before uploading
|
|
|
|
deprecationMessage: >-
|
|
|
|
The inputs have been normalized to use kebab-case.
|
|
|
|
Use `verify-metadata` instead.
|
|
|
|
required: false
|
|
|
|
default: 'true'
|
|
|
|
skip-existing: # Canonical alias for `skip_existing`
|
2020-06-19 15:30:53 -04:00
|
|
|
description: >-
|
|
|
|
Do not fail if a Python package distribution
|
|
|
|
exists in the target package index
|
|
|
|
required: false
|
2023-03-10 21:06:39 -05:00
|
|
|
# default: 'false' # TODO: uncomment once alias removed
|
2023-03-10 19:18:41 -05:00
|
|
|
skip_existing: # DEPRECATED ALIAS; TODO: Remove in v3+
|
|
|
|
description: >-
|
|
|
|
[DEPRECATED]
|
|
|
|
Do not fail if a Python package distribution
|
|
|
|
exists in the target package index
|
|
|
|
deprecationMessage: >-
|
|
|
|
The inputs have been normalized to use kebab-case.
|
|
|
|
Use `skip-existing` instead.
|
|
|
|
required: false
|
|
|
|
default: 'false'
|
2020-09-15 00:31:21 -04:00
|
|
|
verbose:
|
|
|
|
description: Show verbose output.
|
|
|
|
required: false
|
2022-12-06 15:44:04 -05:00
|
|
|
default: 'false'
|
2023-03-10 19:18:41 -05:00
|
|
|
print-hash: # Canonical alias for `print_hash`
|
2022-01-07 23:12:15 -05:00
|
|
|
description: Show hash values of files to be uploaded
|
2022-01-07 11:24:27 -05:00
|
|
|
required: false
|
2023-03-10 21:06:39 -05:00
|
|
|
# default: 'false' # TODO: uncomment once alias removed
|
2023-03-10 19:18:41 -05:00
|
|
|
print_hash: # DEPRECATED ALIAS; TODO: Remove in v3+
|
|
|
|
description: >-
|
|
|
|
[DEPRECATED]
|
|
|
|
Show hash values of files to be uploaded
|
|
|
|
deprecationMessage: >-
|
|
|
|
The inputs have been normalized to use kebab-case.
|
|
|
|
Use `print-hash` instead.
|
|
|
|
required: false
|
|
|
|
default: 'false'
|
2024-08-31 20:50:29 -04:00
|
|
|
attestations:
|
|
|
|
description: >-
|
|
|
|
[EXPERIMENTAL]
|
|
|
|
Enable experimental support for PEP 740 attestations.
|
|
|
|
Only works with PyPI and TestPyPI via Trusted Publishing.
|
|
|
|
required: false
|
2024-10-28 14:31:58 -04:00
|
|
|
default: 'true'
|
2019-08-20 16:48:52 -04:00
|
|
|
branding:
|
|
|
|
color: yellow
|
|
|
|
icon: upload-cloud
|
|
|
|
runs:
|
2024-04-16 03:02:03 -04:00
|
|
|
using: composite
|
|
|
|
steps:
|
|
|
|
- name: Reset path if needed
|
|
|
|
run: |
|
|
|
|
# Reset path if needed
|
|
|
|
# https://github.com/pypa/gh-action-pypi-publish/issues/112
|
|
|
|
if [[ $PATH != *"/usr/bin"* ]]; then
|
|
|
|
echo "\$PATH=$PATH. Resetting \$PATH for GitHub Actions."
|
|
|
|
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
|
|
echo "PATH=$PATH" >>"$GITHUB_ENV"
|
|
|
|
echo "$PATH" >>"$GITHUB_PATH"
|
|
|
|
echo "\$PATH reset. \$PATH=$PATH"
|
|
|
|
fi
|
|
|
|
shell: bash
|
|
|
|
- name: Set repo and ref from which to run Docker container action
|
|
|
|
id: set-repo-and-ref
|
|
|
|
run: |
|
|
|
|
# Set repo and ref from which to run Docker container action
|
|
|
|
# to handle cases in which `github.action_` context is not set
|
|
|
|
# https://github.com/actions/runner/issues/2473
|
2024-05-30 21:34:34 -04:00
|
|
|
REF=${{ env.ACTION_REF || env.PR_REF || github.ref_name }}
|
|
|
|
REPO=${{ env.ACTION_REPO || env.PR_REPO || github.repository }}
|
2024-06-09 16:47:19 -04:00
|
|
|
REPO_OWNER_ID=${{ env.PR_REPO_OWNER_ID || github.repository_owner_id }}
|
2024-04-16 03:02:03 -04:00
|
|
|
echo "ref=$REF" >>"$GITHUB_OUTPUT"
|
|
|
|
echo "repo=$REPO" >>"$GITHUB_OUTPUT"
|
2024-06-09 16:47:19 -04:00
|
|
|
echo "repo-owner-id=$REPO_OWNER_ID" >>"$GITHUB_OUTPUT"
|
2024-04-16 03:02:03 -04:00
|
|
|
shell: bash
|
|
|
|
env:
|
|
|
|
ACTION_REF: ${{ github.action_ref }}
|
|
|
|
ACTION_REPO: ${{ github.action_repository }}
|
2024-05-30 21:34:34 -04:00
|
|
|
PR_REF: ${{ github.event.pull_request.head.ref }}
|
|
|
|
PR_REPO: ${{ github.event.pull_request.head.repo.full_name }}
|
2024-06-09 16:47:19 -04:00
|
|
|
PR_REPO_OWNER_ID: ${{ github.event.pull_request.base.repo.owner.id }}
|
2024-05-27 13:45:20 -04:00
|
|
|
- name: Check out action repo
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: action-repo
|
|
|
|
ref: ${{ steps.set-repo-and-ref.outputs.ref }}
|
|
|
|
repository: ${{ steps.set-repo-and-ref.outputs.repo }}
|
|
|
|
- name: Create Docker container action
|
2024-04-16 03:02:03 -04:00
|
|
|
run: |
|
2024-05-27 13:45:20 -04:00
|
|
|
# Create Docker container action
|
2024-06-01 17:08:20 -04:00
|
|
|
python create-docker-action.py
|
2024-05-27 13:45:20 -04:00
|
|
|
env:
|
|
|
|
EVENT: ${{ github.event_name }}
|
|
|
|
REF: ${{ steps.set-repo-and-ref.outputs.ref }}
|
|
|
|
REPO: ${{ steps.set-repo-and-ref.outputs.repo }}
|
2024-06-09 16:47:19 -04:00
|
|
|
REPO_OWNER_ID: ${{ steps.set-repo-and-ref.outputs.repo-owner-id }}
|
2024-04-16 03:02:03 -04:00
|
|
|
shell: bash
|
2024-05-27 13:45:20 -04:00
|
|
|
working-directory: action-repo
|
2024-04-16 03:02:03 -04:00
|
|
|
- name: Run Docker container
|
2024-05-27 13:45:20 -04:00
|
|
|
uses: ./action-repo/.github/actions/run-docker-container
|
2024-04-16 03:02:03 -04:00
|
|
|
with:
|
|
|
|
user: ${{ inputs.user }}
|
|
|
|
password: ${{ inputs.password }}
|
|
|
|
repository-url: ${{ inputs.repository-url || inputs.repository_url }}
|
|
|
|
packages-dir: ${{ inputs.packages-dir || inputs.packages_dir }}
|
|
|
|
verify-metadata: ${{ inputs.verify-metadata || inputs.verify_metadata }}
|
|
|
|
skip-existing: ${{ inputs.skip-existing || inputs.skip_existing }}
|
|
|
|
verbose: ${{ inputs.verbose }}
|
|
|
|
print-hash: ${{ inputs.print-hash || inputs.print_hash }}
|
|
|
|
attestations: ${{ inputs.attestations }}
|