Skip to content

Commit fe8bb81

Browse files
committed
Automate release
1 parent aa03d8c commit fe8bb81

File tree

4 files changed

+137
-21
lines changed

4 files changed

+137
-21
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
### Description of the pull request
1+
## What does this PR do?
22

3-
...
3+
[Description here]
44

5-
#### Why is the change necessary?
5+
## CHANGELOG
66

7-
...
8-
9-
----
10-
11-
CC @pusher/mobile
7+
- [CHANGED] Describe your change here. Look at CHANGELOG.md to see the format.

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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 }' build.gradle)
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 }' build.gradle)
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+
publish:
63+
runs-on: ubuntu-latest
64+
needs: create-github-release
65+
steps:
66+
- uses: actions/checkout@v2
67+
- name: Create gradle.properties
68+
shell: bash
69+
run: |
70+
mkdir -p ~/.gradle/
71+
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
72+
cat <<FILE > ~/.gradle/gradle.properties
73+
github.username=${{ secrets.PUSHER_CI_GITHUB_PRIVATE_TOKEN }}
74+
github.password=""
75+
maven.username=${{ secrets.MAVEN_USERNAME }}
76+
maven.password=${{ secrets.MAVEN_PASSWORD }}
77+
signing.keyId=${{ secrets.SIGNING_KEY_ID }}
78+
signing.password=${{ secrets.SIGNING_PASSWORD }}
79+
signing.secretKeyRingFile=~/.gradle/pusher-maven-gpg-signing-key.gpg
80+
FILE
81+
echo "${{ secrets.PUSHER_MAVEN_GPG_SIGNING_KEY }}" | base64 --decode > ~/.gradle/pusher-maven-gpg-signing-key.gpg
82+
- name: Publish
83+
run: |
84+
./gradlew publish

.github/workflows/release_pr.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 }' build.gradle)
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/version = "${{env.CURRENT_VERSION}}"/version = "${{steps.bump.outputs.new_version}}"/' build.gradle
32+
perl -pi -e 's/${{env.CURRENT_VERSION}}/${{steps.bump.outputs.new_version}}/' README.md
33+
34+
git add build.gradle README.md CHANGELOG.md
35+
git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}"
36+
git push

CHANGELOG.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
# pusher-websocket-java changelog
1+
# Changelog
22

3-
### Version 2.4.2 - 23th Sep 2022
3+
## Version 2.4.2 - 23th Sep 2022
44
* Fixes a crash when an event comes in without and escaped data json member.
55
* update to com.google.code.gson:gson:2.9.1
66
* update to org.java-websocket:Java-WebSocket:1.5.3
77

8-
### Version 2.4.1 - 13th Sep 2022
8+
## Version 2.4.1 - 13th Sep 2022
99
* Refactoring and code cleanup of event handling in the SDK
1010
* Fixes subscription_count events
1111

12-
### Version 2.4.0 - 15th July 2022
12+
## Version 2.4.0 - 15th July 2022
1313
* Add support for Subscription count events
1414

15-
### Version 2.3.0 - 4th July 2022
15+
## Version 2.3.0 - 4th July 2022
1616
* Added support for user sign in and server to user messages
1717
* Fixed issue with calling disconnect while the client is attempting reconnection
1818
* Fixed issue with calling connect while the client is disconnecting
1919

20-
### Version 2.2.8 - 30th November 2021
20+
## Version 2.2.8 - 30th November 2021
2121
* Add global [event listner](https://github.com/pusher/pusher-websocket-java/issues/305)
2222

23-
### Version 2.2.7 - 11th November 2021
23+
## Version 2.2.7 - 11th November 2021
2424
* Fixed an [issue Vulnerability with legacy Gson dependency](https://github.com/pusher/pusher-websocket-java/issues/305)
2525

26-
### Version 2.2.6 - 17th March 2021
26+
## Version 2.2.6 - 17th March 2021
2727
* Fixed an [issue causing a NullPointerException if event data on a Presence channel was malformed or missing](https://github.com/pusher/pusher-websocket-java/pull/290)
2828

29-
### Version 2.2.5 - 11th August 2020
29+
## Version 2.2.5 - 11th August 2020
3030
* Fixed an [issue with the Java-WebSocket library with android pre-sdk24 devices causing a NoSuchMethod exception](https://github.com/pusher/pusher-websocket-java/pull/284)
3131

32-
### Version 2.2.4 - 3rd August 2020
32+
## Version 2.2.4 - 3rd August 2020
3333
* Removed unnecessary code in the TweetNaClFast implementation
3434
* Updated the Java-WebSocket library to 1.5.1 as the [current version 1.4.0 has a known critical vulnerability.](https://github.com/pusher/pusher-websocket-java/issues/279)
3535

36-
### Version 2.2.3 - 8th July 2020
36+
## Version 2.2.3 - 8th July 2020
3737

3838
* Fixed LazySodium causing a crash on Android devices by swapping it out for [TweetNaCl](https://github.com/InstantWebP2P/tweetnacl-java)
3939

40-
### Version 2.2.2 - 6th July 2020
40+
## Version 2.2.2 - 6th July 2020
4141

4242
* Fixed an issue where some private encrypted messages were not decrypted accurately by swapping our implementation of SecretBoxOpener for one provided by [Lazy Sodium](https://github.com/terl/lazysodium-java)
4343

44-
### Version 2.2.1 - 22nd April 2020
44+
## Version 2.2.1 - 22nd April 2020
4545

4646
* Changed PusherOptions `setForceTLS` and `isForceTLS` to `setUseTLS` and `isUseTLS` to align with the other client SDKs.
4747

0 commit comments

Comments
 (0)