File tree Expand file tree Collapse file tree 4 files changed +45
-18
lines changed Expand file tree Collapse file tree 4 files changed +45
-18
lines changed Original file line number Diff line number Diff line change @@ -8,24 +8,11 @@ If everything seems OK, you can proceed to do the following:
8
8
1 . Update the version string in ` internal/version/version.go ` and run ` make gen ` .
9
9
2 . Add details in ` CHANGELOG.md ` on what changed.
10
10
3 . Create a PR with the subject ` chore: update version to X.Y.Z `
11
- 4 . Once the above PR is approved and merged, create a new git tag ` vX.Y.Z ` pointing to the commit of the above PR merged to ` main ` :
11
+ 4 . Once the above PR is approved and merged, update your local branch and run ` release.sh ` .
12
+ If the script reports errors, fix them before continuing.
13
+ If there are no issues, it will output the Github tag URL.
12
14
13
- ``` shell
14
- # Ensure your local copy is up to date with main. Be sure to stash any changes first.
15
- git fetch origin
16
- git reset --hard origin/main
17
- # Fetch existing tags first!
18
- git fetch --tags
19
- git tag -a vX.Y.Z -m ' vX.Y.Z'
20
- ```
21
-
22
- 5 . Push the tag:
23
-
24
- ``` shell
25
- git push origin tag vX.Y.Z
26
- ```
27
-
28
- 6 . Visit ` https://github.com/coder/agentapi/releases/tag/vX.Y.Z ` and "Create release from tag".
15
+ 5 . Visit ` https://github.com/coder/agentapi/releases/tag/vX.Y.Z ` and "Create release from tag".
29
16
30
17
- Select the tag you pushed previously.
31
18
- Select the previous tag and "Generate release notes". Amend as required.
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
//go:generate sh -c "go run main.go server --print-openapi dummy > openapi.json"
4
- //go:generate ./set_version .sh
4
+ //go:generate ./version .sh
5
5
import "github.com/coder/agentapi/cmd"
6
6
7
7
func main () {
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ GIT_BRANCH=" ${GIT_BRANCH:- main} "
5
+ echo " GIT_BRANCH=${GIT_BRANCH} "
6
+ LOCAL_HEAD=$( git rev-parse --short " ${GIT_BRANCH} " )
7
+ echo " LOCAL_HEAD=${LOCAL_HEAD} "
8
+ REMOTE_HEAD=$( git rev-parse --short origin/" ${GIT_BRANCH} " )
9
+ echo " REMOTE_HEAD=${REMOTE_HEAD} "
10
+ if [[ " ${LOCAL_HEAD} " != " ${REMOTE_HEAD} " ]]; then
11
+ echo " Please ensure your local branch is up to date before continuing."
12
+ exit 1
13
+ fi
14
+
15
+ VERSION=" "
16
+ if ! VERSION=$( ./version.sh) ; then
17
+ echo " version.sh exited with a non-zero status code. Fix this before continuing."
18
+ exit 1
19
+ elif [[ -z " ${VERSION} " ]]; then
20
+ echo " Version reported by version.sh was empty. Fix this before continuing."
21
+ exit 1
22
+ fi
23
+
24
+ echo " VERSION=${VERSION} "
25
+ ./check_unstaged.sh || exit 1
26
+
27
+ if ! grep -q " ## v${VERSION} " CHANGELOG.md; then
28
+ echo " Please update CHANGELOG.md with details for ${VERSION} before continuing."
29
+ exit 1
30
+ fi
31
+
32
+ TAG_NAME=" v${VERSION} "
33
+ echo " TAG_NAME=${TAG_NAME} "
34
+ git fetch --tags
35
+ git tag -a " ${TAG_NAME} " -m " ${TAG_NAME} "
36
+ git push origin tag " ${TAG_NAME} "
37
+
38
+ echo " https://github.com/coder/agentapi/releases/new?tag=${TAG_NAME} "
Original file line number Diff line number Diff line change @@ -11,3 +11,5 @@ version=$(go run main.go --version | awk '{print $3}')
11
11
12
12
jq --arg version " ${version} " ' .info.version = $version' openapi.json > openapi.json.tmp && mv openapi.json.tmp openapi.json
13
13
jq --arg version " ${version} " ' .version = $version' chat/package.json > chat/package.json.tmp && mv chat/package.json.tmp chat/package.json
14
+
15
+ echo -n " ${version} "
You can’t perform that action at this time.
0 commit comments