microsoft/gctoolkit
Publicmirrored from https://github.com/microsoft/gctoolkitAvailable
.devops/scripts/github-release.sh
22lines · modeblame
f3cdec59David Grieve1 years ago | 1 | #!/bin/bash |
| 2 | | |
| 3 | set -euxo pipefail | |
| 4 | | |
| 5 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
| 6 | PROJECT_HOME=$SCRIPT_DIR/../.. | |
| 7 | | |
| 8 | cd $PROJECT_HOME | |
| 9 | | |
| 10 | previous_release_version=$( \ | |
| 11 | curl --location --silent \ | |
| 12 | -H "Accept: application/vnd.github+json" \ | |
| 13 | https://api.github.com/repos/microsoft/gctoolkit/releases/latest | grep 'tag_name' \ | |
| 14 | ) | |
d7040222David Grieve1 years ago | 15 | previous_release_version=$( perl -pe 's/"tag_name":\s+"(.*?)",?/$1/' <<< "${previous_release_version}" ) |
f3cdec59David Grieve1 years ago | 16 | |
| 17 | release_version=$( git tag --sort=-taggerdate --list | head -n 1 ) | |
| 18 | | |
| 19 | ./mvnw -B -pl :gctoolkit -Pjreleaser jreleaser:release \ | |
d7040222David Grieve1 years ago | 20 | -Djreleaser.previous.tag.name="${previous_release_version}" \ |
| 21 | -Djreleaser.tag.name="${release_version}" | |
f3cdec59David Grieve1 years ago | 22 | |