-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
release-prepare-release.sh
executable file
·62 lines (50 loc) · 1.96 KB
/
release-prepare-release.sh
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
#!/bin/bash -ex
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0
PATTERN="^[0-9]+\.[0-9]+\.[0-9]+.*"
if ! [[ ${CURRENT_BETA} =~ $PATTERN ]]
then
echo "CURRENT_BETA should follow a semver format and not be led by a v"
exit 1
fi
if ! [[ ${CANDIDATE_BETA} =~ $PATTERN ]]
then
echo "CANDIDATE_BETA should follow a semver format and not be led by a v"
exit 1
fi
make chlog-update VERSION="v${CANDIDATE_BETA}"
git config user.name opentelemetrybot
git config user.email 107717825+opentelemetrybot@users.noreply.github.com
BRANCH="prepare-release-prs/${CANDIDATE_BETA}"
git checkout -b "${BRANCH}"
git add --all
git commit -m "changelog update ${CANDIDATE_BETA}"
sed -i.bak "s/${CURRENT_BETA}/${CANDIDATE_BETA}/g" versions.yaml
find . -name "*.bak" -type f -delete
git add versions.yaml
git commit -m "update version.yaml ${CANDIDATE_BETA}"
sed -i.bak "s/${CURRENT_BETA}/${CANDIDATE_BETA}/g" ./cmd/oteltestbedcol/builder-config.yaml
sed -i.bak "s/${CURRENT_BETA}/${CANDIDATE_BETA}/g" ./cmd/otelcontribcol/builder-config.yaml
find . -name "*.bak" -type f -delete
make genotelcontribcol
make genoteltestbedcol
git add .
git commit -m "builder config changes ${CANDIDATE_BETA}" || (echo "no builder config changes to commit")
make multimod-prerelease
git add .
git commit -m "make multimod-prerelease changes ${CANDIDATE_BETA}" || (echo "no multimod changes to commit")
make multimod-sync
git add .
git commit -m "make multimod-sync changes ${CANDIDATE_BETA}" || (echo "no multimod changes to commit")
make gotidy
git add .
git commit -m "make gotidy changes ${CANDIDATE_BETA}" || (echo "no gotidy changes to commit")
make otelcontribcol
git push origin "${BRANCH}"
gh pr create --title "[chore] Prepare release ${CANDIDATE_BETA}" --body "
The following commands were run to prepare this release:
- make chlog-update VERSION=v${CANDIDATE_BETA}
- sed -i.bak s/${CURRENT_BETA}/${CANDIDATE_BETA}/g versions.yaml
- make multimod-prerelease
- make multimod-sync
"