File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # Usage: ./scripts/release.sh <version>
2
+ # Usage: ./scripts/release.sh
3
3
set -ex
4
4
5
- if [ $# -ne 1 ]; then
6
- echo " Usage: ./release.sh <version>"
7
- exit 1
8
- fi
9
-
10
5
# Prechecks
11
6
if [ " $( git rev-parse --abbrev-ref HEAD) " != " main" ]; then
12
7
echo " You must be on the main branch to release"
15
10
git diff --exit-code
16
11
17
12
# Bump version
18
- NEW_VERSION=$1
13
+ NEW_VERSION=$( cat .codspeed-runner-version )
19
14
# verify that NEW_VERSION is a valid semver
20
15
if ! [[ " $NEW_VERSION " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
21
16
echo " Version must be a valid semver (e.g. 1.2.3)"
22
17
exit 1
23
18
fi
24
19
MAJOR_VERSION=$( echo $NEW_VERSION | cut -d. -f1)
25
20
21
+ # Ask for confirmation
22
+ read -p " Are you sure you want to release v$NEW_VERSION ? Bumping the v$MAJOR_VERSION major version ?(y/n) " -n 1 -r
23
+ echo
24
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
25
+ exit 1
26
+ fi
27
+
26
28
# Fail if there are any unstaged changes left
27
29
git diff --exit-code
28
30
git commit -m " Release v$NEW_VERSION 🚀" --allow-empty
@@ -31,4 +33,7 @@ git tag -s -fa v$MAJOR_VERSION -m "Release v$NEW_VERSION 🚀"
31
33
git push origin tag v$NEW_VERSION
32
34
git push -f origin tag v$MAJOR_VERSION
33
35
git push --follow-tags
34
- gh release create v$NEW_VERSION --title " v$NEW_VERSION " --generate-notes -d
36
+
37
+ RUNNER_NOTES=$( gh release view v$NEW_VERSION -R CodSpeedHQ/runner --json body | jq -r .body)
38
+ RUNNER_NOTES=" $RUNNER_NOTES \n\nFull Runner Changelog: https://github.com/CodSpeedHQ/runner/blob/main/CHANGELOG.md"
39
+ gh release create v$NEW_VERSION --title " v$NEW_VERSION " --notes " $RUNNER_NOTES " -d
You can’t perform that action at this time.
0 commit comments