File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
2- # Usage: ./scripts/release.sh <version>
2+ # Usage: ./scripts/release.sh
33set -ex
44
5- if [ $# -ne 1 ]; then
6- echo " Usage: ./release.sh <version>"
7- exit 1
8- fi
9-
105# Prechecks
116if [ " $( git rev-parse --abbrev-ref HEAD) " != " main" ]; then
127 echo " You must be on the main branch to release"
1510git diff --exit-code
1611
1712# Bump version
18- NEW_VERSION=$1
13+ NEW_VERSION=$( cat .codspeed-runner-version )
1914# verify that NEW_VERSION is a valid semver
2015if ! [[ " $NEW_VERSION " =~ ^[0-9]+\. [0-9]+\. [0-9]+$ ]]; then
2116 echo " Version must be a valid semver (e.g. 1.2.3)"
2217 exit 1
2318fi
2419MAJOR_VERSION=$( echo $NEW_VERSION | cut -d. -f1)
2520
21+ # Ask for confirmation
22+ read -p " Are you sure you want to release v$NEW_VERSION ? (y/n) " -n 1 -r
23+ echo
24+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
25+ exit 1
26+ fi
27+
2628# Fail if there are any unstaged changes left
2729git diff --exit-code
2830git commit -m " Release v$NEW_VERSION 🚀" --allow-empty
@@ -31,4 +33,7 @@ git tag -s -fa v$MAJOR_VERSION -m "Release v$NEW_VERSION 🚀"
3133git push origin tag v$NEW_VERSION
3234git push -f origin tag v$MAJOR_VERSION
3335git 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