-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed68659
commit ecf475b
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Github Action: pypi-build-publish | ||
|
||
Github action to build and publish to PyPI [PEP 518](https://www.python.org/dev/peps/pep-0518/) compliant projects (flit, poetry,...). | ||
|
||
Usage: | ||
|
||
```yaml | ||
- use: conchylicultor/pypi-build-publish@v1 | ||
with: | ||
pypi-token: ${{ secrets.PYPI_API_TOKEN }} | ||
``` | ||
The action assume: | ||
* The project has a `pyproject.toml` (or `setup.py`) in the top-level directory. | ||
* Python and pip are installed (e.g. by `actions/setup-python@v2`). | ||
|
||
## Inputs | ||
|
||
* `pypi-token`: The PyPI API token to use. (required) | ||
|
||
## Outputs | ||
|
||
None. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: 'Build & Publish to PyPI' | ||
author: 'Conchylicultor' | ||
description: 'Build and publish to PyPI for PEP 518 compliant projects (flit, poetry,...).' | ||
branding: | ||
icon: upload-cloud | ||
color: orange | ||
|
||
inputs: | ||
pypi-token: | ||
description: 'Token of the PyPI account publishing the project.' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- run: pip install build twine | ||
shell: bash | ||
- run: python -m build | ||
shell: bash | ||
- run: twine check dist/* | ||
shell: bash | ||
- run: twine upload dist/* | ||
shell: bash | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ inputs.pypi-token }} |