This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
123 lines (102 loc) · 3.75 KB
/
rc_create.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Create RC branches
on:
workflow_dispatch:
inputs:
version:
description: The release version in v*.*.* format
required: true
jobs:
build:
runs-on: ubuntu-latest
env:
VERSION: ${{ github.event.inputs.version }}
RC_BRANCH: ''
steps:
- name: Validate input
run: |
echo $RC_BRANCH
if [[ ! $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Wrong version format provided, please use v*.*.* format"
exit 1
fi
- name: Define release branch name in the format "release-*.*.*"
run: |
echo "RC_BRANCH=release-${VERSION#v}" >> $GITHUB_ENV
- name: Configure git for private modules
env:
ROBOT_TOKEN: ${{ secrets.ROBOT_TOKEN }}
run: git config --global url."https://percona-platform-robot:${ROBOT_TOKEN}@github.com".insteadOf "https://github.com"
- name: Check out Everest CLI
uses: actions/checkout@v4
with:
repository: percona/percona-everest-cli
ref: 'main'
path: percona-everest-cli
token: ${{ secrets.ROBOT_TOKEN }}
- name: Create Everest CLI RC-branch
run: |
cd percona-everest-cli
# Check if the branch already exists
git fetch
check_branch=$(git ls-remote --heads origin ${RC_BRANCH})
if [[ -z ${check_branch} ]]; then
git checkout -b $RC_BRANCH
git push origin $RC_BRANCH
fi
- name: Check out Everest catalog
uses: actions/checkout@v4
with:
repository: percona/everest-catalog
ref: 'main'
path: everest-catalog
token: ${{ secrets.ROBOT_TOKEN }}
- name: Create Everest catalog RC-branch
run: |
cd everest-catalog
# Check if the branch already exists
git fetch
check_branch=$(git ls-remote --heads origin ${RC_BRANCH})
if [[ -z ${check_branch} ]]; then
git checkout -b $RC_BRANCH
git push origin $RC_BRANCH
fi
- name: Check out Everest frontend
uses: actions/checkout@v4
with:
repository: percona/percona-everest-frontend
ref: 'main'
path: percona-everest-frontend
token: ${{ secrets.ROBOT_TOKEN }}
- name: Create Everest Frontend RC-branch
run: |
cd percona-everest-frontend
# Check if the branch already exists
git fetch
check_branch=$(git ls-remote --heads origin ${RC_BRANCH})
if [[ -z ${check_branch} ]]; then
git checkout -b $RC_BRANCH
git push origin $RC_BRANCH
fi
- name: Check out Everest Backend
uses: actions/checkout@v4
with:
path: ./backend
ref: 'main'
- name: Create and update Everest Backend RC-branch
run: |
cd backend
# Check if the branch already exists
git fetch
check_branch=$(git ls-remote --heads origin ${RC_BRANCH})
if [[ -z ${check_branch} ]]; then
git checkout -b $RC_BRANCH
git push origin $RC_BRANCH
# update tag refs in scripts
sed -i "s/dev-latest/$VERSION/g" deploy/quickstart-compose.yml deploy/quickstart-k8s.yaml
# configure userdata for commits
git config --global user.email "[email protected]"
git config --global user.name "Everest RC CI triggered by ${{ github.actor }}"
# commit and push the updated files
git commit -a -m "update version tag"
git push origin $RC_BRANCH
fi