Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 4c6c2cf

Browse files
authored
Automated releases (#44)
* Adding build/release action * Split the build actions so that production builds only happen on release creation * 1.0 time
1 parent c7d2fc7 commit 4c6c2cf

File tree

6 files changed

+83
-17
lines changed

6 files changed

+83
-17
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish Python 🐍 distributions 📦 to pypi
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
build-n-publish:
10+
name: Build and publish Python 🐍 distributions 📦 to pypi
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@master
14+
- name: Set up Python 3.9
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.9
18+
19+
- name: Install pypa/build
20+
run: >-
21+
python -m
22+
pip install
23+
build
24+
--user
25+
- name: Build a binary wheel and a source tarball
26+
run: >-
27+
python -m
28+
build
29+
--sdist
30+
--wheel
31+
--outdir dist/
32+
.
33+
34+
- name: Publish distribution 📦 to PyPI
35+
if: startsWith(github.ref, 'refs/tags')
36+
uses: pypa/gh-action-pypi-publish@master
37+
with:
38+
password: ${{ secrets.PYPI_API_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish Python 🐍 distributions 📦 to TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Set up Python 3.9
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.9
15+
16+
- name: Install pypa/build
17+
run: >-
18+
python -m
19+
pip install
20+
build
21+
--user
22+
- name: Build a binary wheel and a source tarball
23+
run: >-
24+
python -m
25+
build
26+
--sdist
27+
--wheel
28+
--outdir dist/
29+
.
30+
31+
- name: Publish distribution 📦 to Test PyPI
32+
uses: pypa/gh-action-pypi-publish@master
33+
with:
34+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
35+
repository_url: https://test.pypi.org/legacy/

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ Change Log
44
This document records all notable changes to [django-bleach](https://github.com/marksweb/django-bleach).
55
This project adheres to [Semantic Versioning](https://semver.org/).
66

7-
[unreleased](https://github.com/marksweb/django-bleach/compare/0.9.0...master) changes
7+
[unreleased](https://github.com/marksweb/django-bleach/compare/1.0.0...master) changes
88
-------------------------------------------------------------------------------------
99

10+
Version 1.0.0
11+
=============
12+
###### 13-11-2021
13+
Going to 1.0 is long overdue, especially considering SemVer.
14+
* automated pypi releases via github actions
1015
* pre-commit hooks
1116
* python 3.10 support
1217
* docs syntax highlighting [#38](https://github.com/marksweb/django-bleach/pull/38)

django_bleach/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
__author__ = "Tim Heap & Mark Walker"
2-
__version__ = "0.9.0"
2+
__version__ = "1.0.0"
33

44
VERSION = __version__.split(".")

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
# Minimum requirements for the build system to execute.
3+
requires = ["setuptools", "wheel"] # PEP 508 specifications.

setup.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,6 @@ def find_variable(variable, *parts):
5555
release = find_variable('__version__', 'django_bleach', '__init__.py')
5656
version = release.rstrip('.')
5757

58-
if sys.argv[-1] == 'build':
59-
os.system('python setup.py sdist bdist_wheel')
60-
sys.exit()
61-
62-
if sys.argv[-1] == 'release':
63-
os.system('twine upload -r django-bleach --skip-existing dist/*')
64-
sys.exit()
65-
66-
if sys.argv[-1] == 'tag':
67-
print("Tagging the version on github:")
68-
os.system(f"git tag -a {version} -m 'version {version}'")
69-
os.system("git push --tags")
70-
sys.exit()
71-
72-
7358
setup(
7459
name=name,
7560
version=version,

0 commit comments

Comments
 (0)