File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ eval " $( pkgx --shellcode) " ; env +yq
3+ set -euo pipefail
4+
5+ INCREMENT=${1:- PATCH}
6+
7+ increment_version () {
8+ local version=$1
9+ local part=$2
10+ IFS=' .' read -ra VERSION_PARTS <<< " $version"
11+ case " $part " in
12+ MAJOR)
13+ VERSION_PARTS[0]=$(( VERSION_PARTS[0 ]+ 1 ))
14+ VERSION_PARTS[1]=0
15+ VERSION_PARTS[2]=0
16+ ;;
17+ MINOR)
18+ VERSION_PARTS[1]=$(( VERSION_PARTS[1 ]+ 1 ))
19+ VERSION_PARTS[2]=0
20+ ;;
21+ PATCH)
22+ VERSION_PARTS[2]=$(( VERSION_PARTS[2 ]+ 1 ))
23+ ;;
24+ esac
25+ echo " ${VERSION_PARTS[0]} .${VERSION_PARTS[1]} .${VERSION_PARTS[2]} "
26+ }
27+
28+ current_version=$( yq e ' .env.VERSION' .pkgx.yaml)
29+ new_version=$( increment_version $current_version $INCREMENT )
30+ yq e -i " .env.VERSION = \" $new_version \" " .pkgx.yaml
31+ git add .pkgx.yaml
32+ git commit -m " Release v$new_version "
33+ echo " Release v$new_version committed."
You can’t perform that action at this time.
0 commit comments