Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: RubyGems release

on:
push:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Publish gem
uses: dawidd6/action-publish-gem@v1
with:
api_key: ${{secrets.RUBYGEMS_API_KEY}}
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

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

jobs:
prepare-release:
name: Prepare release
runs-on: ubuntu-latest

steps:
- name: Set major release
if: ${{ github.event.label.name == 'release-major' }}
run: echo "RELEASE=major" >> $GITHUB_ENV
- name: Set minor release
if: ${{ github.event.label.name == 'release-minor' }}
run: echo "RELEASE=minor" >> $GITHUB_ENV
- name: Set patch release
if: ${{ github.event.label.name == 'release-patch' }}
run: echo "RELEASE=patch" >> $GITHUB_ENV
- name: Check release env
run: |
if [[ -z "${{ env.RELEASE }}" ]];
then
echo "You need to set a release label on PRs to the main branch"
exit 1
else
exit 0
fi
- name: Install semver-tool
run: |
export DIR=$(mktemp -d)
cd $DIR
curl https://github.com/fsaintjacques/semver-tool/archive/3.2.0.tar.gz -L -o semver.tar.gz
tar -xvf semver.tar.gz
sudo cp semver-tool-3.2.0/src/semver /usr/local/bin
- name: Bump version
run: |
export CURRENT=$(gem info messagebird-rest --remote --exact | grep -o "messagebird-rest ([0-9]*\.[0-9]*\.[0-9]*)" | awk -F '[()]' '{print $2}')
export NEW_VERSION=$(semver bump ${{ env.RELEASE }} $CURRENT)
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2
- name: Setup git
run: |
git config user.email "developers@messagebird.com"
git config user.name "MessageBird CI"
git fetch
git checkout ${{ github.event.pull_request.head.ref }}
- 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 commit -m "Bump to version ${{ env.VERSION }}"
- name: Push
run: git push
7 changes: 5 additions & 2 deletions .github/workflows/ruby_ci.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Ruby CI
name: Tests

on: [ push, pull_request ]
on:
pull_request:
push:
branches: [master, main]

jobs:
ci:
Expand Down
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.0.0'
STRING = '3.1.0'
end
end