Skip to content

Commit

Permalink
Automate release (#83)
Browse files Browse the repository at this point in the history
* Automate release
* Add PR template
* Reformat Changelog.md
  • Loading branch information
sonologico authored Oct 14, 2022
1 parent 87ed92a commit c3c7d91
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 32 deletions.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## What does this PR do?

[Description here]

## CHANGELOG

- [CHANGED] Describe your change here. Look at CHANGELOG.md to see the format.
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
push:
branches: [ master ]

jobs:
check-release-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Prepare tag
id: prepare_tag
continue-on-error: true
run: |
export TAG=v$(awk '/libraryVersion =/ { gsub("\"",""); print $3 }' client.go)
echo "TAG=$TAG" >> $GITHUB_ENV
export CHECK_TAG=$(git tag | grep $TAG)
if [[ $CHECK_TAG ]]; then
echo "Skipping because release tag already exists"
exit 1
fi
- name: Output
id: release_output
if: ${{ steps.prepare_tag.outcome == 'success' }}
run: |
echo "::set-output name=tag::${{ env.TAG }}"
outputs:
tag: ${{ steps.release_output.outputs.tag }}

create-github-release:
runs-on: ubuntu-latest
needs: check-release-tag
if: ${{ needs.check-release-tag.outputs.tag }}
steps:
- uses: actions/checkout@v2
- name: Prepare tag
run: |
export TAG=v$(jq -r '.version' package.json)
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Setup git
run: |
git config user.email "pusher-ci@pusher.com"
git config user.name "Pusher CI"
- name: Prepare description
run: |
csplit -s CHANGELOG.md "/##/" {1}
cat xx01 > CHANGELOG.tmp
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG }}
release_name: ${{ env.TAG }}
body_path: CHANGELOG.tmp
draft: false
prerelease: false
35 changes: 35 additions & 0 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: release

on:
pull_request:
types: [ labeled ]
branches:
- master

jobs:
prepare-release:
name: Prepare release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get current version
shell: bash
run: |
CURRENT_VERSION=$(awk '/libraryVersion =/ { gsub("\"",""); print $3 }' client.go)
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
- uses: actions/checkout@v2
with:
repository: pusher/public_actions
path: .github/actions
- uses: ./.github/actions/prepare-version-bump
id: bump
with:
current_version: ${{ env.CURRENT_VERSION }}
- name: Push
shell: bash
run: |
sed -i'' -e 's/${{env.CURRENT_VERSION}}/${{steps.bump.outputs.new_version}}/' client.go
git add client.go CHANGELOG.md
git commit -m "Bump to version ${{ steps.bump.outputs.new_version }}"
git push
56 changes: 24 additions & 32 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
5.0.0 / 2021-02-19
==================
# Changelog

## 5.0.0 / 2021-02-19

* Breaking change: `TriggerBatch` now returns `(*TriggerBatchChannelsList, error)` instead of `error`
* Breaking change: `Channels` takes `ChannelsParams` as a parameter instead of `map[string]string`
* Breaking change: `Channel` takes `ChannelParams` as a parameter instead of `map[string]string`
Expand All @@ -8,28 +10,28 @@
* Added a `Info` field to the `Event` type passed to `TriggerBatch`
* Deprecated `TriggerExclusive` and `TriggerMultiExclusive` (use `TriggerWithParams` and `TriggerMultiWithParams` instead)

4.0.4 / 2020-09-02
==================
## 4.0.4 / 2020-09-02

* Allow message size to be overridden for dedicate cluster customers (PR [#63](https://github.com/pusher/pusher-http-go/pull/71))

4.0.3 / 2020-07-28
==================
## 4.0.3 / 2020-07-28

* Added library name and version in HTTP Header (PR [#62](https://github.com/pusher/pusher-http-go/pull/62))
* Changed: allow larger (10KB -> 20KB) requests as we sometimes do on dedicated clusters (PR [#66](https://github.com/pusher/pusher-http-go/pull/66))

4.0.2 / 2020-07-28
==================
## 4.0.2 / 2020-07-28

* Added `go.mod` for managing the library as a Go module
* Changed `github.com/stretchr/testify/assert` with a stable `gopkg.in/stretchr/testify.v1/assert`

4.0.1 / 2020-04-01
==================
## 4.0.1 / 2020-04-01


* Added EncryptionMasterKeyBase64 parameter
* Deprecated EncryptionMasterKey parameter

4.0.0 / 2019-05-31
==================
## 4.0.0 / 2019-05-31

* This release modifies the entire repo to respect the go linter. This is a significant API breaking change and will likely require you to correct references to the names that were changed in your code. All future releases will respect the linter. A summary of the changes:
* Rename AppId > AppID
* Rename UserId > UserID
Expand All @@ -38,57 +40,47 @@
* Rename HttpClient > HTTPClient
* Improved comments and tabbing

3.0.0 / 2019-05-31
==================
## 3.0.0 / 2019-05-31

* This release removes the `*BufferedEvents` return from calls to `trigger` is it never did anything. Our documentation elsewhere conflicted with this, and it made the library more complex than it needed to be, so we removed it.

2.0.0 / 2019-05-31
==================
## 2.0.0 / 2019-05-31

* This release removes support for Push Notifications. Check out https://pusher.com/beams for our new, improved Push Notification offering!

1.3.0 / 2018-08-13
==================
## 1.3.0 / 2018-08-13

* This release adds support for end to end encrypted channels, a new feature for Channels. Read more [in our docs](https://pusher.com/docs/client_api_guide/client_encrypted_channels).

1.2.0 / 2016-05-24
==================
## 1.2.0 / 2016-05-24

* Add support for batch events

1.1.0 / 2016-02-22
==================
## 1.1.0 / 2016-02-22

* Introduce a `Cluster` option for the Pusher initializer.

1.0.0 / 2015-05-14
==================
## 1.0.0 / 2015-05-14

* Users can pass in a `http.Client` instance to the Pusher initializer. They can configure this instance directly to have specific options e.g. timeouts.
* Therefore, the `Timeout` field on `pusher.Client` is deprecated.
* `HttpClient()` function is no longer public. HTTP Client configuration is now done on the `HttpClient` **property** of `pusher.Client`. Read [here](https://github.com/pusher/pusher-http-go#request-timeouts) for more details.
* If no `HttpClient` is specified, the library creates one with a default timeout of 5 seconds.
* The library is now GAE compatible. Read [here](https://github.com/pusher/pusher-http-go#google-app-engine) for more details.

0.2.2 / 2015-05-12
==================
## 0.2.2 / 2015-05-12

* Socket_ids are now validated upon Trigger*Exclusive and channel authentication.

0.2.1 / 2015-04-30
==================
## 0.2.1 / 2015-04-30

* Webhook validation uses hmac.Equals to guard against timing attacks.

0.2.0 / 2015-03-30
==================
## 0.2.0 / 2015-03-30

* A HTTP client is shared between requests to allow configuration. If none is set by the user, the library supplies a default. Allows for pipelining or to change the transport.

0.1.0 / 2015-03-26
==================
## 0.1.0 / 2015-03-26

* Instantiation of client from credentials, URL or environment variables.
* User can trigger Pusher events on single channels, multiple channels, and exclude recipients
Expand Down

0 comments on commit c3c7d91

Please sign in to comment.