Skip to content

Commit 7c916df

Browse files
author
marcel corso gonzalez
authored
Merge pull request #74 from messagebird/add_changelog
Add changelog file and tagging release
2 parents 63b3595 + 668e330 commit 7c916df

File tree

4 files changed

+56
-2
lines changed

4 files changed

+56
-2
lines changed

.github/workflows/gh-release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
create-release:
9+
name: Create Release
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Setup git
15+
run: |
16+
git config user.email "[email protected]"
17+
git config user.name "MessageBird CI"
18+
- name: Prepare description
19+
run: |
20+
csplit -s CHANGELOG.md "/##/" {1}
21+
cat xx01 > CHANGELOG.tmp
22+
- name: Prepare tag
23+
run: |
24+
export TAG=$(head -1 CHANGELOG.tmp | cut -d' ' -f2)
25+
echo "TAG=$TAG" >> $GITHUB_ENV
26+
- name: Create Release
27+
uses: actions/create-release@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
with:
31+
tag_name: ${{ env.TAG }}
32+
release_name: ${{ env.TAG }}
33+
body_path: CHANGELOG.tmp
34+
draft: false
35+
prerelease: false

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,21 @@ jobs:
5050
git config user.name "MessageBird CI"
5151
git fetch
5252
git checkout ${{ github.event.pull_request.head.ref }}
53+
- name: Prepare CHANGELOG
54+
run: |
55+
echo "${{ github.event.pull_request.body }}" | csplit -s - "/##/"
56+
echo "# Changelog
57+
## ${{ env.VERSION }}
58+
" >> CHANGELOG.tmp
59+
grep "^*" xx01 >> CHANGELOG.tmp
60+
grep -v "^# " CHANGELOG.md >> CHANGELOG.tmp
61+
cp CHANGELOG.tmp CHANGELOG.md
5362
- name: Prepare version.rb
5463
run: |
5564
sed -i "s|STRING = '[^']*'|STRING = '${{ env.VERSION }}'|" lib/messagebird/version.rb
5665
- name: Commit changes
5766
run: |
58-
git add lib/messagebird/version.rb
67+
git add CHANGELOG.md lib/messagebird/version.rb
5968
git commit -m "Bump to version ${{ env.VERSION }}"
6069
- name: Push
6170
run: git push

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
## 3.1.1
3+
4+
* [ADDED] Add release tagging workflow.
5+
6+
## 3.1.0
7+
8+
* [CHANGED] Deprecate old signed request validation.
9+
* [ADDED] New request validator with JWT webhook signature.
10+
* [ADDED] Add release and publish GitHub actions.

lib/messagebird/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module MessageBird
44
module Version
5-
STRING = '3.1.0'
5+
STRING = '3.1.1'
66
end
77
end

0 commit comments

Comments
 (0)