Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Conchylicultor committed Jan 7, 2022
1 parent ed68659 commit ecf475b
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
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.
26 changes: 26 additions & 0 deletions action.yml
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 }}

0 comments on commit ecf475b

Please sign in to comment.