Skip to content

Commit c1b5058

Browse files
authored
add job to publish releases to PyPi (#7)
* add job to publish releases to PyPi * email * remove unnecessary condition on commmit ref
1 parent 60b0799 commit c1b5058

File tree

4 files changed

+61
-4
lines changed

4 files changed

+61
-4
lines changed

.github/workflows/publish-to-pypi.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish prefect-saturn to PyPI
2+
on:
3+
release:
4+
types:
5+
- published
6+
jobs:
7+
build-and-publish:
8+
name: Build and publish prefect-saturn to PyPI
9+
runs-on: ubuntu-18.04
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python 3.7
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.7
16+
- name: Install build dependencies
17+
run: >-
18+
python -m
19+
pip install
20+
setuptools
21+
wheel
22+
--upgrade
23+
--user
24+
- name: Build a binary wheel and a source tarball
25+
run: >-
26+
python
27+
setup.py
28+
sdist
29+
bdist_wheel
30+
- name: Publish distribution to PyPI
31+
uses: pypa/[email protected]
32+
with:
33+
# Password is set in GitHub UI to an API secret for pypi
34+
user: __token__
35+
password: ${{ secrets.pypi_password }}

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ This document contains details on contributing to `prefect-saturn`.
55
* [Documentation](#documentation)
66
* [Installation](#installation)
77
* [Testing](#testing)
8+
* [Releasing](#releasing)
89

910
## Documentation
1011

@@ -58,3 +59,13 @@ The `unit-tests` recipe in `Makefile` includes a minimum code coverage threshold
5859
`prefect-saturn`'s unit tests mock out its interactions with the rest of Saturn Cloud. Integration tests that test those interactions contain some sensitive information, and are stored in a private repository.
5960

6061
If you experience issues using `prefect-saturn` and Saturn Cloud, please see [the Saturn documentation](#documentation) or contact us at by following the `Contact Us` navigation at https://www.saturncloud.io/s.
62+
63+
## Releasing
64+
65+
This section describes how to release a new version of `prefect-saturn` to PyPi. It is intended only for maintainers.
66+
67+
1. Open a new pull request which bumps the version in `VERSION`. Merge that PR.
68+
2. [Create a new release](https://github.com/saturncloud/prefect-saturn/releases/new)
69+
- the tag should be a version number, like `0.0.1`
70+
- choose the target from "recent commits", and select the most recent commit on `main`
71+
3. Once this release is created, a GitHub Actions build will automatically start. That build publishes a release to PyPi.

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
# prefect-saturn
22

3-
![GitHub Actions](https://github.com/saturncloud/prefect-saturn/workflows/GitHub%20Actions/badge.svg)
3+
![GitHub Actions](https://github.com/saturncloud/prefect-saturn/workflows/GitHub%20Actions/badge.svg) [![PyPI Version](https://img.shields.io/pypi/v/prefect-saturn.svg)](https://pypi.org/project/prefect-saturn)
44

55
`prefect-saturn` is a Python package that makes it easy to run Prefect Cloud flows on a Dask cluster with Saturn Cloud.
66

7+
8+
## Getting Started
9+
10+
`prefect-saturn` is available on PyPi.
11+
12+
```shell
13+
pip install prefect-saturn
14+
```
15+
716
`prefect-saturn` can be installed directly from GitHub
817

918
```shell
1019
pip install git+https://github.com/saturncloud/prefect-saturn.git@main
1120
```
1221

22+
## Contributing
23+
1324
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for documentation on how to test and contribute to `prefect-saturn`.

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
version = f.read().strip()
99

1010
install_requires = ["cloudpickle", "dask-saturn>=0.0.4", "prefect", "requests"]
11-
testing_deps = ["pytest"]
11+
testing_deps = ["pytest", "pytest-cov", "responses"]
1212

1313
setup(
1414
name="prefect-saturn",
1515
version=version,
1616
maintainer="Saturn Cloud Developers",
17-
maintainer_email="dev@saturncloud.io",
17+
maintainer_email="open-source@saturncloud.io",
1818
license="BSD 3-clause",
1919
classifiers=[
2020
"Development Status :: 3 - Alpha",
@@ -43,6 +43,6 @@
4343
python_requires=">=3.6",
4444
extras_require={"dev": install_requires + testing_deps},
4545
test_suite="tests",
46-
test_require=["pytest", "pytest-cov", "responses"],
46+
test_require=testing_deps,
4747
zip_safe=False,
4848
)

0 commit comments

Comments
 (0)