Skip to content

Release 2.15.0

Release 2.15.0 #231

name: Branch Protection
on:
pull_request:
types: [opened, edited, synchronize]
branches:
- master
- develop
jobs:
check-rc-pattern:
runs-on: ubuntu-latest
if: startsWith(github.head_ref, 'release')
steps:
- name: Check RC pattern
run: |
if [[ "${{ github.head_ref }}" =~ release/[0-9]+\.[0-9]+\.[0-9]+-rc ]]; then
echo "Branch name contains release/version-rc pattern. Merging is not allowed. Only stable release should be merge into master"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check-master-version:
needs: check-rc-pattern
runs-on: ubuntu-latest
if: github.base_ref == 'master' && startsWith(github.head_ref, 'release')
steps:
- name: Checkout master branch
uses: actions/checkout@v4
with:
ref: master
path: master
submodules: recursive
- name: Checkout release branch
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
path: release
submodules: recursive
- name: Extract versions
run: |
MASTER_VERSION=$(grep '^SDK_VERSION_NAME=' master/gradle.properties | cut -d '=' -f2)
RELEASE_VERSION=$(grep '^SDK_VERSION_NAME=' release/gradle.properties | cut -d '=' -f2)
echo "MASTER_VERSION=$MASTER_VERSION" >> $GITHUB_ENV
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Compare versions
uses: jackbilestech/semver-compare@1.0.4
with:
head: ${{ env.RELEASE_VERSION }}
base: ${{ env.MASTER_VERSION }}
operator: '>='