https://github.com/bkeepers/python-actions
GitHub Actions for Python packaging and distribution
https://github.com/bkeepers/python-actions
Last synced: 12 months ago
JSON representation
GitHub Actions for Python packaging and distribution
- Host: GitHub
- URL: https://github.com/bkeepers/python-actions
- Owner: bkeepers
- License: mit
- Created: 2018-10-16T20:26:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T20:27:47.000Z (over 7 years ago)
- Last Synced: 2025-01-18T06:25:03.480Z (over 1 year ago)
- Language: Dockerfile
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Actions for Python packaging and distribution
These Actions support building [Python](https://www.python.org/) packages with setup.py and uploading them to [PyPi](https://pypi.python.org) or alternate repositories using the [twine](https://pypi.org/project/twine/) utility.
## setup.py (check & build)
See [setup-py README](setup-py/README.md) for usage details.
## twine (package upload)
See [twine README](twine/README.md) for usage details.
## Usage
An example workflow to check, build, and upload a Python package to PyPi follows. `` should be replaced with a [supported version](#supported-python-versions) and `` should generally be replaced with a release tag e.g. `rel-0.0.1` or a commit sha e.g. `aa63e12e998c56713d9cbba3ddf211281db3178f` or `aa63e12` for short. Finally `` should be replaced with the name of your python module. It is possible to upload multiple files and to customize other options, see the [twine docs](https://pypi.org/project/twine/) for more information.
```hcl
workflow "check, sdist, and upload" {
on = "push"
resolves = ["upload"]
}
action "tag-filter" {
uses = "docker://alpine"
args = ["sh", "-c", "echo $GITHUB_REF | grep -Eq refs/tags.*"]
}
action "check" {
uses = "ross/python-actions/setup-py/@"
args = "check"
needs = "tag-filter"
}
action "sdist" {
uses = "ross/python-actions/setup-py/@"
args = "sdist"
needs = "check"
}
action "upload" {
uses = "ross/python-actions/twine@"
args = "upload ./dist/-*.tar.gz"
secrets = ["TWINE_PASSWORD", "TWINE_USERNAME"]
needs = "sdist"
}
```
## License
The Dockerfiles and associated scripts and documentation in this project are released under the [MIT License](LICENSE).