Publishes a Python package using PDM.
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/publish-python-package@v10
with:
index-user: __token__
index-secret: ${{ secrets.PYPI_TOKEN }}Please, note: this action is designed for publication only - not for verification: you may want to use verify-python-package for that.
-
Run enforce-branch-version, forwarding the
enforce-branch-versioninput to itsmodeinput. -
If the
pdmcommand is not installed (at the requestedpdm-version, if declared), install it via pipx; upon installation, the latest version will be retrieved ifpdm-versionis not specified. -
Run publish-github-pages on
website-directory, with theoptionalflag enabled. -
Run
pdm publish, passing theindex-inputs as environment variables; ifdry-runis enabled, just perform apdm build, skipping actual deployment.
-
pipxis mandatory when PDM has to be installed. -
The requirements for publish-github-pages if
website-directoryreferences an existing directory. -
Before the first publication, running with
dry-runset to true is recommended.
| Name | Type | Description | Default value |
|---|---|---|---|
dry-run |
boolean | Run a simulated publication | false |
pdm-version |
string | Version of PDM that should be used | |
index-url |
string | URL of the target index | |
index-user |
string | User for publishing to the index | |
index-secret |
string | Password/token for publishing to the index | |
website-directory |
string | Relative directory containing the project website | website |
enforce-branch-version |
inject,check,skip |
How the branch version should be enforced | inject |
project-directory |
string | The directory containing pyproject.toml |
. |