-
Notifications
You must be signed in to change notification settings - Fork 41
/
release.sh
executable file
·30 lines (20 loc) · 977 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
set -euxo pipefail
: "${1?"Usage: $0 <[pre]major|[pre]minor|[pre]patch|prerelease>"}"
: "${CHANGELOG_GITHUB_TOKEN?"Needs CHANGELOG_GITHUB_TOKEN env var"}"
./mvnw scm:check-local-modification
current=$({ echo 0.0.0; git tag --list --sort=version:refname; } | tail -n1)
release=$(semver "${current}" -i "$1" --preid RC)
next=$(semver "${release}" -i minor)
git checkout -b "release/${release}"
./mvnw versions:set -D newVersion="${release}"
git commit -am "Release ${release}"
./mvnw clean deploy scm:tag -P release -D tag="${release}" -D pushChanges=false -D skipTests -D dependency-check.skip
git push --tags
./mvnw versions:set -D newVersion="${next}-SNAPSHOT"
docker run -it --rm -e CHANGELOG_GITHUB_TOKEN -v "$(pwd)":/usr/local/src/your-app \
githubchangeloggenerator/github-changelog-generator -u zalando -p jackson-datatype-money
git commit -am "Development ${next}-SNAPSHOT"
git push
git checkout main
git branch -D "release/${release}"