-
Notifications
You must be signed in to change notification settings - Fork 25
57 lines (51 loc) · 1.89 KB
/
create-release-branch-workflow.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Create Release Branch
on:
workflow_dispatch:
inputs:
versionName:
description: 'Name of version (ie 5.5.0)'
required: true
iosVersion:
description: 'iOS SDK version number (5.5.0)'
required: true
AndroidVersion:
description: 'Android SDK version number (5.5.0)'
required: true
DeployToQA:
required: false
description: 'Deploy to QA (open PR and publish RC)'
type: boolean
default: false
jobs:
createRelease:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Login to Github
env:
COMMIT_AUTHOR: ${{ secrets.CI_COMMIT_AUTHOR }}
COMMIT_EMAIL: ${{ secrets.CI_COMMIT_EMAIL }}
run: |
git config --global user.name $COMMIT_AUTHOR
git config --global user.email $COMMIT_EMAIL
- name: Create New Branch
id: createBranch
run: |
major=$(echo ${{ inputs.versionName }}| cut -d'.' -f 1)
minor=$(echo ${{ inputs.versionName }}| cut -d'.' -f 2)
patch=$(echo ${{ inputs.versionName }}| cut -d'.' -f 3)
branchName=$(printf "releases/%s.x.x/%s.%s.x/%s.%s.%s" $major $major $minor $major $minor $patch)
export branchName
echo "BRANCH_NAME=$branchName" >> $GITHUB_ENV
git checkout -b $branchName
- name: Update Codebase
run: |
.github/workflows/scripts/updatePlugin.sh pluginVersion=${{ inputs.versionName }} buildNumber=${{ github.run_number }} iOSVersion=${{ inputs.iosVersion }} androidVersion=${{ inputs.AndroidVersion }}
git commit -m "update versions using CI"
git push -u origin --all
- name: create pull request
if: ${{ inputs.DeployToQA }}
env:
GITHUB_TOKEN: ${{ secrets.CI_DEV_GITHUB_TOKEN }}
run: |
gh pr create -B main --title "Merge ${{ env.BRANCH_NAME }} into main" --body 'Created by Github action'