Skip to content

Commit bd99e3e

Browse files
committed
Pull request 2150: AG-28455 rc versions
Squashed commit of the following: commit 9b80bf2 Merge: 2c18415 fede297 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Feb 16 15:49:23 2024 +0300 Merge branch 'master' into AG-28455-rc-versions commit 2c18415 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Feb 14 13:01:30 2024 +0300 scripts: imp code commit f096505 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Feb 13 14:52:10 2024 +0300 scripts: imp code commit a5bed23 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Feb 12 18:35:52 2024 +0300 scripts: fix typo commit 36e9ea1 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Feb 12 15:41:57 2024 +0300 scripts: revert changes, imp docs commit d74c85d Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Mon Feb 5 18:12:38 2024 +0300 all: mark rc versions separately
1 parent fede297 commit bd99e3e

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

bamboo-specs/test.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'name': 'AdGuard Home - Build and run tests'
77
'variables':
88
'dockerGo': 'adguard/golang-ubuntu:8.0'
9+
'channel': 'development'
910

1011
'stages':
1112
- 'Tests':
@@ -73,7 +74,7 @@
7374
make\
7475
ARCH="amd64"\
7576
OS="windows darwin linux"\
76-
CHANNEL="development"\
77+
CHANNEL=${bamboo.channel}\
7778
SIGN=0\
7879
PARALLELISM=1\
7980
VERBOSE=2\
@@ -115,3 +116,16 @@
115116
'labels': []
116117
'other':
117118
'concurrent-build-plugin': 'system-default'
119+
120+
'branch-overrides':
121+
# rc-vX.Y.Z branches are the release candidate branches. They are created
122+
# from the release branch and are used to build the release candidate
123+
# images.
124+
- '^rc-v[0-9]+\.[0-9]+\.[0-9]+':
125+
# Build betas on release branches manually.
126+
'triggers': []
127+
# Set the default release channel on the release branch to beta, as we
128+
# may need to build a few of these.
129+
'variables':
130+
'dockerGo': 'adguard/golang-ubuntu:8.0'
131+
'channel': 'candidate'

scripts/make/go-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ readonly channel
5151

5252
case "$channel"
5353
in
54-
('development'|'edge'|'beta'|'release')
54+
('development'|'edge'|'beta'|'release'|'candidate')
5555
# All is well, go on.
5656
;;
5757
(*)
5858
echo "invalid channel '$channel', supported values are\
59-
'development', 'edge', 'beta', and 'release'" 1>&2
59+
'development', 'edge', 'beta', 'release', and 'candidate'" 1>&2
6060
exit 1
6161
;;
6262
esac

scripts/make/version.sh

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bump_minor='/^v[0-9]+\.[0-9]+\.0$/ {
4343
}
4444
4545
{
46-
printf("invalid release version: \"%s\"\n", $0);
46+
printf("invalid minor release version: \"%s\"\n", $0);
4747
4848
exit 1;
4949
}'
@@ -128,15 +128,40 @@ in
128128

129129
version="$last_tag"
130130
;;
131+
('candidate')
132+
# This pseudo-channel is used to set a proper versions into release
133+
# candidate builds.
134+
135+
# last_tag is expected to be the latest release tag.
136+
last_tag="$( git describe --abbrev=0 )"
137+
readonly last_tag
138+
139+
# current_branch is the name of the branch currently checked out.
140+
current_branch="$( git rev-parse --abbrev-ref HEAD )"
141+
readonly current_branch
142+
143+
# The branch should be named like:
144+
#
145+
# rc-v12.34.56
146+
#
147+
if ! echo "$current_branch" | grep -E -e '^rc-v[0-9]+\.[0-9]+\.[0-9]+$' -q
148+
then
149+
echo "invalid release candidate branch name '$current_branch'" 1>&2
150+
151+
exit 1
152+
fi
153+
154+
version="${current_branch#rc-}-rc.$( git rev-list --count "$last_tag"..HEAD )"
155+
;;
131156
(*)
132157
echo "invalid channel '$channel', supported values are\
133-
'development', 'edge', 'beta', and 'release'" 1>&2
158+
'development', 'edge', 'beta', 'release' and 'candidate'" 1>&2
134159
exit 1
135160
;;
136161
esac
137162

138163
# Finally, make sure that we don't output invalid versions.
139-
if ! echo "$version" | grep -E -e '^v[0-9]+\.[0-9]+\.[0-9]+(-(a|b|dev)\.[0-9]+)?(\+[[:xdigit:]]+)?$' -q
164+
if ! echo "$version" | grep -E -e '^v[0-9]+\.[0-9]+\.[0-9]+(-(a|b|dev|rc)\.[0-9]+)?(\+[[:xdigit:]]+)?$' -q
140165
then
141166
echo "generated an invalid version '$version'" 1>&2
142167

0 commit comments

Comments
 (0)