forked from bkdevops-projects/devops-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (33 loc) · 1.17 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Create release branch from master or hotfix
name: Create release branch
on:
workflow_dispatch:
jobs:
create-release:
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ github.event.inputs.release_version }}
NEXT_VERSION: ${{ github.event.inputs.next_version }}
steps:
- name: Check branch
if: github.ref_name != 'master' && startsWith(github.ref_name,'hotfix-') != true
run: |
echo "Create release branch can only from master or hotfix-** branch"
exit 1
- uses: actions/checkout@v2
- name: Setup git configuration
run: |
git config user.name "bkci-bot"
git config user.email "[email protected]"
- name: Release
run: |
./gradlew generateReleaseProperties
./gradlew release
- name: Push new release branch
run: |
version=$(grep "release.version=" release.properties | awk -F "=" '{print $2}')
release_branch=release-$version
echo "version=$version"
echo "branch_name=$release_branch"
git checkout -b $release_branch v$version
git push origin $release_branch