microsoft/gctoolkit
Publicmirrored fromhttps://github.com/microsoft/gctoolkitAvailable
.devops/scripts/github-release.sh
22lines · modecode
| 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 | ) |
| 15 | previous_release_version=$( perl -pe 's/"tag_name":\s+"(.*?)",?/$1/' <<< "${previous_release_version}" ) |
| 16 | |
| 17 | release_version=$( git tag --sort=-taggerdate --list | head -n 1 ) |
| 18 | |
| 19 | ./mvnw -B -pl :gctoolkit -Pjreleaser jreleaser:release \ |
| 20 | -Djreleaser.previous.tag.name="${previous_release_version}" \ |
| 21 | -Djreleaser.tag.name="${release_version}" |
| 22 | |
| 23 | |