doc: move the configuration to its own section
Signed-off-by: Frost Ming <me@frostming.com>
This commit is contained in:
parent
ddc33ca746
commit
0b61a6c732
54
README.md
54
README.md
@ -9,43 +9,47 @@ But it is still not obvious and it is a pain for developers to properly build th
|
||||
|
||||
## Usage
|
||||
|
||||
Include the action in your workflow yaml file with the following arguments:
|
||||
Include the action in your workflow yaml:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
...
|
||||
- uses: pdm-project/setup-pdm@v3
|
||||
name: Setup PDM
|
||||
with:
|
||||
python-version: 3.9 # Version range or exact version of a Python version to use, the same as actions/setup-python
|
||||
architecture: x64 # The target architecture (x86, x64) of the Python interpreter. the same as actions/setup-python
|
||||
version: 2.7.4 # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub
|
||||
prerelease: false # Allow prerelease versions of PDM to be installed
|
||||
enable-pep582: false # Enable PEP 582 package loading globally
|
||||
allow-python-prereleases: false # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fallback to 3.12-dev
|
||||
update-python: true # Update the environment with the requested python version
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup PDM
|
||||
uses: pdm-project/setup-pdm@v3
|
||||
# You are now able to use PDM in your workflow
|
||||
- name: Install dependencies
|
||||
run: pdm install # Then you can use pdm in the following steps.
|
||||
...
|
||||
run: pdm install
|
||||
```
|
||||
|
||||
You don't need `actions/setup-python` actually.
|
||||
|
||||
## Action Inputs
|
||||
|
||||
This action supports the following inputs:
|
||||
|
||||
| Input | Default | Description |
|
||||
| -------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `python-version` | `3.x` | Version range or exact version of a Python version to use, using SemVer's version range syntax. |
|
||||
| `architecture` | `x64` | The target architecture (x86, x64) of the Python interpreter. |
|
||||
| `allow-python-prereleases` | `false` | Allow prerelease versions of Python to be installed. |
|
||||
| `token` | `${{ github.token }}` | Used to pull python distributions from actions/python-versions. Since there's a default, this is typically not supplied by the user. |
|
||||
| `version` | Not specified | The version of PDM to install, or 'head' to install from the main branch. |
|
||||
| `prerelease` | `false` | Allow prerelease versions of PDM to be installed |
|
||||
| `enable-pep582` | `false` | Enable PEP 582 package loading globally. |
|
||||
| `cache` | `false` | Cache PDM installation. |
|
||||
| `cache-dependency-path` | `pdm.lock` | The dependency file(s) to cache. |
|
||||
| `update-python` | `true` | Whether to update the environment with the requested Python |
|
||||
|
||||
## Action Outputs
|
||||
|
||||
This action also exposes the following outputs:
|
||||
|
||||
```yaml
|
||||
outputs:
|
||||
python-version:
|
||||
description: "The installed Python or PyPy version. Useful when given a version range as input."
|
||||
python-path:
|
||||
description: "The absolute path to the Python or PyPy executable."
|
||||
pdm-version:
|
||||
description: "The installed PDM version."
|
||||
pdm-bin:
|
||||
description: "The absolute path to the PDM executable."
|
||||
```
|
||||
| Output | Description |
|
||||
| ---------------- | --------------------------------------------------------------------------------- |
|
||||
| `python-version` | The installed Python or PyPy version. Useful when given a version range as input. |
|
||||
| `python-path` | The absolute path to the Python or PyPy executable. |
|
||||
| `pdm-version` | The installed PDM version. |
|
||||
| `pdm-bin` | The absolute path to the PDM executable. |
|
||||
|
||||
## Caches
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user