Skip to content

Commit 50dec39

Browse files
cumason123di
andauthored
added pypi-release rule (cloudevents#87)
* added pypi-release rule Signed-off-by: Curtis Mason <cumason@google.com> * added RELEASING.md Signed-off-by: Curtis Mason <cumason@google.com> * Adjusted RELEASING.md Signed-off-by: Curtis Mason <cumason@google.com> * Update .github/workflows/pypi-release.yml Co-authored-by: Dustin Ingram <di@users.noreply.github.com> Signed-off-by: Curtis Mason <cumason@google.com> * workflow pypi name changed Signed-off-by: Curtis Mason <cumason@google.com> * Update RELEASING.md Co-authored-by: Dustin Ingram <di@users.noreply.github.com> Signed-off-by: Curtis Mason <cumason@google.com> * Update RELEASING.md Co-authored-by: Dustin Ingram <di@users.noreply.github.com> Signed-off-by: Curtis Mason <cumason@google.com> * Update RELEASING.md Co-authored-by: Dustin Ingram <di@users.noreply.github.com> Signed-off-by: Curtis Mason <cumason@google.com> * removed some pbr stuff Signed-off-by: Curtis Mason <cumason@google.com> * Removed all pbr stuff Signed-off-by: Curtis Mason <cumason@google.com> * README nits Signed-off-by: Curtis Mason <cumason@google.com> * RELEASING adjustment in README Signed-off-by: Curtis Mason <cumason@google.com> * author update in setup.cfg Signed-off-by: Curtis Mason <cumason@google.com> * removed setup.cfg Signed-off-by: Curtis Mason <cumason@bu.edu> * Update setup.py Co-authored-by: Dustin Ingram <di@users.noreply.github.com> Signed-off-by: Curtis Mason <cumason@bu.edu> * lint fix Signed-off-by: Curtis Mason <cumason@bu.edu> Co-authored-by: Dustin Ingram <di@users.noreply.github.com>
1 parent f07f993 commit 50dec39

File tree

6 files changed

+70
-65
lines changed

6 files changed

+70
-65
lines changed

.github/workflows/pypi-release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: PyPI-Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: "3.x"
17+
- name: Install build dependencies
18+
run: pip install -U setuptools wheel build
19+
- name: Build
20+
run: python -m build .
21+
- name: Publish
22+
uses: pypa/gh-action-pypi-publish@master
23+
with:
24+
password: ${{ secrets.pypi_password }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,5 @@ e.g.
131131
pip install tox
132132
tox -e reformat
133133
```
134+
135+
For information on releasing version bumps see [RELEASING.md](RELEASING.md)

RELEASING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Releasing CloudEvents SDK for Python
2+
3+
This repository is configured to automatically publish the corresponding [PyPI
4+
package](https://pypi.org/project/cloudevents/) via GitHub Actions.
5+
6+
To release a new CloudEvents SDK, contributors should bump the `version` in
7+
[setup.py](setup.py)) to reflect the new release version. On merge, the action
8+
will automatically build and release to PyPI using
9+
[this PyPI GitHub Action](https://github.com/pypa/gh-action-pypi-publish). This
10+
action gets called on all pushes to master (such as a version branch being merged
11+
into master), but only releases a new version when the version number has changed.
12+
13+
After a version update is merged, maintainers are expected to manually create a
14+
corresponding tag/release.
15+
16+
View the GitHub workflow [pypi-release.yml](.github/workflows/pypi-release.yml) for
17+
more information.

release.sh

Lines changed: 0 additions & 35 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 29 deletions
This file was deleted.

setup.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,31 @@
1414

1515
import setuptools
1616

17+
import pathlib
1718

18-
setuptools.setup(setup_requires=["pbr>=2.0.0"], pbr=True)
19+
20+
here = pathlib.Path(__file__).parent.resolve()
21+
long_description = (here / "README.md").read_text(encoding="utf-8")
22+
23+
setuptools.setup(
24+
name="cloudevents",
25+
summary="CloudEvents SDK Python",
26+
long_description_content_type="text/markdown",
27+
long_description=long_description,
28+
author="The Cloud Events Contributors",
29+
author_email="cncfcloudevents@gmail.com",
30+
home_page="https://cloudevents.io",
31+
classifiers=[
32+
"Intended Audience :: Information Technology",
33+
"Intended Audience :: System Administrators",
34+
"License :: OSI Approved :: Apache Software License",
35+
"Operating System :: POSIX :: Linux",
36+
"Programming Language :: Python :: 3",
37+
"Programming Language :: Python :: 3.6",
38+
"Programming Language :: Python :: 3.7",
39+
"Programming Language :: Python :: 3.8",
40+
],
41+
package_dir={"": "cloudevents"},
42+
packages=["http", "sdk"],
43+
version="1.0.0",
44+
)

0 commit comments

Comments
 (0)