Skip to content

Commit

Permalink
Merge pull request #74 from messagebird/add_changelog
Browse files Browse the repository at this point in the history
Add changelog file and tagging release
  • Loading branch information
marcel corso gonzalez authored Mar 31, 2022
2 parents 63b3595 + 668e330 commit 7c916df
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Github Release

on:
push:
branches: [ master ]

jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup git
run: |
git config user.email "developers@messagebird.com"
git config user.name "MessageBird CI"
- name: Prepare description
run: |
csplit -s CHANGELOG.md "/##/" {1}
cat xx01 > CHANGELOG.tmp
- name: Prepare tag
run: |
export TAG=$(head -1 CHANGELOG.tmp | cut -d' ' -f2)
echo "TAG=$TAG" >> $GITHUB_ENV
- 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
11 changes: 10 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,21 @@ jobs:
git config user.name "MessageBird CI"
git fetch
git checkout ${{ github.event.pull_request.head.ref }}
- name: Prepare CHANGELOG
run: |
echo "${{ github.event.pull_request.body }}" | csplit -s - "/##/"
echo "# Changelog
## ${{ env.VERSION }}
" >> CHANGELOG.tmp
grep "^*" xx01 >> CHANGELOG.tmp
grep -v "^# " CHANGELOG.md >> CHANGELOG.tmp
cp CHANGELOG.tmp CHANGELOG.md
- name: Prepare version.rb
run: |
sed -i "s|STRING = '[^']*'|STRING = '${{ env.VERSION }}'|" lib/messagebird/version.rb
- name: Commit changes
run: |
git add lib/messagebird/version.rb
git add CHANGELOG.md lib/messagebird/version.rb
git commit -m "Bump to version ${{ env.VERSION }}"
- name: Push
run: git push
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changelog
## 3.1.1

* [ADDED] Add release tagging workflow.

## 3.1.0

* [CHANGED] Deprecate old signed request validation.
* [ADDED] New request validator with JWT webhook signature.
* [ADDED] Add release and publish GitHub actions.
2 changes: 1 addition & 1 deletion lib/messagebird/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module MessageBird
module Version
STRING = '3.1.0'
STRING = '3.1.1'
end
end

0 comments on commit 7c916df

Please sign in to comment.