Skip to content

Commit cf9bab7

Browse files
Fixed release script (zalando#981)
1 parent a3a5a45 commit cf9bab7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

release.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
#!/bin/sh -ex
22

3-
: ${1?"Usage: $0 <[pre]major|[pre]minor|[pre]patch|prerelease>"}
3+
: "${1?"Usage: $0 <[pre]major|[pre]minor|[pre]patch|prerelease>"}"
44

55
./mvnw scm:check-local-modification
66

7-
current=$(git describe --abbrev=0 || echo 0.0.0)
8-
release=$(semver ${current} -i $1 --preid RC)
9-
next=$(semver ${release} -i minor)
7+
current=$({ echo 0.0.0; git tag --list --sort=version:refname; } | tail -n1)
8+
release=$(semver "${current}" -i "$1" --preid RC)
9+
next=$(semver "${release}" -i minor)
1010

11-
git checkout -b release/${release}
11+
git checkout -b "release/${release}"
1212

13-
./mvnw versions:set -D newVersion=${release}
13+
./mvnw versions:set -D newVersion="${release}"
1414
git commit -am "Release ${release}"
15-
./mvnw clean deploy scm:tag -P release -D tag=${release} -D pushChanges=false -D skipTests -D dependency-check.skip
15+
./mvnw clean deploy scm:tag -P release -D tag="${release}" -D pushChanges=false -D skipTests -D dependency-check.skip
1616

17-
./mvnw versions:set -D newVersion=${next}-SNAPSHOT
17+
./mvnw versions:set -D newVersion="${next}-SNAPSHOT"
1818
git commit -am "Development ${next}-SNAPSHOT"
1919

2020
git push
2121
git push --tags
2222

2323
git checkout main
24-
git branch -D release/${release}
24+
git branch -D "release/${release}"

0 commit comments

Comments
 (0)