Skip to content

Commit 3d1dcfa

Browse files
authored
Automate release (#187)
1 parent 732c4fe commit 3d1dcfa

File tree

4 files changed

+154
-30
lines changed

4 files changed

+154
-30
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,9 @@
1+
## What does this PR do?
2+
3+
[Description here]
4+
15
- [ ] If you have changed dependencies, ensure _both_ `requirements.txt` and `setup.py` have been updated
6+
7+
## CHANGELOG
8+
9+
- [CHANGED] Describe your change here. Look at CHANGELOG.md to see the format.

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
5+
jobs:
6+
check-release-tag:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Prepare tag
14+
id: prepare_tag
15+
continue-on-error: true
16+
run: |
17+
export TAG=v$(awk '/VERSION =/ { gsub("'"\'"'",""); print $3 }' pusher/version.py)
18+
echo "TAG=$TAG" >> $GITHUB_ENV
19+
20+
export CHECK_TAG=$(git tag | grep $TAG)
21+
if [[ $CHECK_TAG ]]; then
22+
echo "Skipping because release tag already exists"
23+
exit 1
24+
fi
25+
- name: Output
26+
id: release_output
27+
if: ${{ steps.prepare_tag.outcome == 'success' }}
28+
run: |
29+
echo "::set-output name=tag::${{ env.TAG }}"
30+
outputs:
31+
tag: ${{ steps.release_output.outputs.tag }}
32+
33+
create-github-release:
34+
runs-on: ubuntu-latest
35+
needs: check-release-tag
36+
if: ${{ needs.check-release-tag.outputs.tag }}
37+
steps:
38+
- uses: actions/checkout@v2
39+
- name: Prepare tag
40+
run: |
41+
export TAG=v$(awk '/VERSION =/ { gsub("'"\'"'",""); print $3 }' pusher/version.py)
42+
echo "TAG=$TAG" >> $GITHUB_ENV
43+
- name: Setup git
44+
run: |
45+
git config user.email "[email protected]"
46+
git config user.name "Pusher CI"
47+
- name: Prepare description
48+
run: |
49+
csplit -s CHANGELOG.md "/##/" {1}
50+
cat xx01 > CHANGELOG.tmp
51+
- name: Create Release
52+
uses: actions/create-release@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
tag_name: ${{ env.TAG }}
57+
release_name: ${{ env.TAG }}
58+
body_path: CHANGELOG.tmp
59+
draft: false
60+
prerelease: false
61+
62+
upload-to-PyPI:
63+
runs-on: ubuntu-latest
64+
needs: create-github-release
65+
steps:
66+
- uses: actions/checkout@v2
67+
- uses: actions/setup-python@v4
68+
with:
69+
python-version: '3.10'
70+
- name: Build package
71+
run: |
72+
pip install --user setuptools wheel twine
73+
rm -rf dist
74+
mkdir dist
75+
python setup.py sdist bdist_wheel
76+
- name: Publish a Python distribution to PyPI
77+
uses: pypa/gh-action-pypi-publish@release/v1
78+
with:
79+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release_pr.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: release
2+
3+
on:
4+
pull_request:
5+
types: [ labeled ]
6+
branches:
7+
- master
8+
9+
jobs:
10+
prepare-release:
11+
name: Prepare release
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Get current version
16+
shell: bash
17+
run: |
18+
CURRENT_VERSION=$(awk '/VERSION =/ { gsub("'"\'"'",""); print $3 }' pusher/version.py)
19+
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
20+
- uses: actions/checkout@v2
21+
with:
22+
repository: pusher/public_actions
23+
path: .github/actions
24+
- uses: ./.github/actions/prepare-version-bump
25+
id: bump
26+
with:
27+
current_version: ${{ env.CURRENT_VERSION }}
28+
- name: Push
29+
shell: bash
30+
run: |
31+
perl -pi -e 's/${{env.CURRENT_VERSION}}/${{steps.bump.outputs.new_version}}/' pusher/version.py
32+
33+
git add pusher/version.py CHANGELOG.md
34+
git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}"
35+
git push

CHANGELOG.md

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,141 @@
1-
### 3.2.0 2022-01-25
1+
# Changelog
2+
3+
## 3.2.0 2022-01-25
24

35
* [FIXED] An issue where payload size wasn't being calculated properly
46

5-
### 3.1.0 2021-10-07
7+
## 3.1.0 2021-10-07
68

79
* [FIXED] Expired root certificates
810

9-
### 3.0.0 2020-04-01
11+
## 3.0.0 2020-04-01
1012

1113
* [ADDED] option `encryption_master_key_base64`
1214
* [DEPRECATED] option `encryption_master_key`
1315

1416
* [REMOVED] old support for Push Notifications, see https://github.com/pusher/push-notifications-python
1517

16-
### 2.1.4 2019-08-09
18+
## 2.1.4 2019-08-09
1719

1820
* [FIXED] TypeError in AuthenticationClient when using encrypted channels
1921
* [FIXED] RequestsDependencyWarning by updating `requests`
2022
* [FIXED] Suppress httpretty warnings
2123
* [ADDED] Tests for AuthenticationClient with encrypted channels
2224

23-
### 2.1.3 2019-02-26
25+
## 2.1.3 2019-02-26
2426

2527
* Import Abstract Base Classes from collections.abc in Python versions >= 3.3
2628

27-
### 2.1.2 2019-01-02
29+
## 2.1.2 2019-01-02
2830

2931
* Fixes issue where encryption_master_key wasn't passed to NotificationClient to initialise the parent class.
3032

31-
### 2.1.1 2018-12-13
33+
## 2.1.1 2018-12-13
3234

3335
* Add pynacl as a dependency
3436

35-
### 2.1.0 2018-12-13
37+
## 2.1.0 2018-12-13
3638

3739
* Added End-to-end Encryption
3840
* Fix ability to pass options to Tornado Backend
3941

40-
### 2.0.2 2018-11-05
42+
## 2.0.2 2018-11-05
4143

4244
* Support Tornado 5, drop support for Tornado 4
4345
* Check for error responses with AsyncIO backend
4446

45-
### 2.0.1 2018-05-21
47+
## 2.0.1 2018-05-21
4648

4749
* Fix issue where aiohttp ClientSession was not being closed
4850

49-
### 2.0.0 2018-05-03
51+
## 2.0.0 2018-05-03
5052

5153
* Drop support for Python 2.6, 3.3
5254
* Drop support for Python 3.4 with the aiohttp adaptor
5355

54-
### 1.7.4 2018-02-05
56+
## 1.7.4 2018-02-05
5557

5658
* Properly close client after request in aiohttp adaptor
5759

58-
### 1.7.3 2018-01-24
60+
## 1.7.3 2018-01-24
5961

6062
* Replace `read_and_close` with `text` in aiohttp adaptor (method removed
6163
upstream)
6264

63-
### 1.7.2 2017-07-19
65+
## 1.7.2 2017-07-19
6466

6567
* Remove `webhook_level` option to notify (depricated upstream)
6668

6769
* Increase notify timeout to 30s
6870

69-
### 1.7.1 2017-06-12
71+
## 1.7.1 2017-06-12
7072

7173
* Make python 2 and 3 support explicit in `setup.py`
7274

7375
* Lift trigger channel limit to 100 for consistency with API
7476

75-
### 1.7.0 2017-05-12
77+
## 1.7.0 2017-05-12
7678

7779
* Remove version freeze from urllib3 since upstream bugfix has been released. (See [here](https://github.com/shazow/urllib3/pull/987).)
7880

79-
### 1.6.0 1016-10-26
81+
## 1.6.0 1016-10-26
8082

8183
* Path to cacert.pem has been added to the setup.py, resolving an oversight that led to errors upon SSL requests.
8284
* Internal changes to ease future maintenance.
8385

84-
### 1.5.0 2016-08-23
86+
## 1.5.0 2016-08-23
8587

8688
* Add support for publishing push notifications on up to 10 interests.
8789

88-
### 1.4.0 2016-08-15
90+
## 1.4.0 2016-08-15
8991

9092
* Add support for sending push notifications.
9193

92-
### 1.3.0 2016-05-24
94+
## 1.3.0 2016-05-24
9395

9496
* Add support for batch events
9597

96-
### 1.2.3 2015-06-22
98+
## 1.2.3 2015-06-22
9799

98100
* Fixes sharing default mutable argument between requests
99101
* Only load RequestsBackend when required (avoids issues on GAE)
100102

101-
### 1.2.2 2015-06-12
103+
## 1.2.2 2015-06-12
102104

103105
Added Wheel file publishing. No functional changes.
104106

105-
### 1.2.1 2015-06-03
107+
## 1.2.1 2015-06-03
106108

107109
Added cacert.pem to the package, getting rid of errors upon SSL calls.
108110

109-
### 1.2.0 2015-05-29
111+
## 1.2.0 2015-05-29
110112

111113
* Renamed `URLFetchBackend` to `GAEBackend`, which specifically imports the Google App Engine urlfetch library.
112114
* Library creates an SSL context from certificate, addressing users receiving `InsecurePlatformWarning`s.
113115

114-
### 1.1.3 2015-05-12
116+
## 1.1.3 2015-05-12
115117

116118
Tightened up socket_id validation regex.
117119

118-
### 1.1.2 2015-05-08
120+
## 1.1.2 2015-05-08
119121

120122
Fixed oversight in socket_id validation regex.
121123

122-
### 1.1.1 2015-05-08
124+
## 1.1.1 2015-05-08
123125

124126
* Library now validates `socket_id` for the `trigger` method.
125127

126-
### 1.1.0 2015-05-07
128+
## 1.1.0 2015-05-07
127129

128130
* User can now specify a custom JSON encoder or decoder upon initializing Pusher.
129131

130-
### 1.0.0 2015-04-25
132+
## 1.0.0 2015-04-25
131133

132134
* Python 2.6, 2.7 and 3.3 support
133135
* Adapters for various http libraries like requests, urlfetch, aiohttp and tornado.
134136
* WebHook validation
135137
* Signature generation for socket subscriptions
136138

137-
### 0.1.0 2014-09-01
139+
## 0.1.0 2014-09-01
138140

139141
* First release

0 commit comments

Comments
 (0)