-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from infinum/maven-central-migration
Maven central migration
- Loading branch information
Showing
21 changed files
with
255 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,35 @@ | ||
plugins { | ||
id("io.github.gradle-nexus.publish-plugin") version "1.0.0" | ||
} | ||
|
||
buildscript { | ||
repositories { | ||
maven { url = uri("https://plugins.gradle.org/m2/") } | ||
jcenter() | ||
mavenCentral() | ||
} | ||
dependencies { | ||
classpath("com.novoda:bintray-release:0.9.1") | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
} | ||
|
||
group = "com.infinum" | ||
version = "3.0.0" | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype() | ||
} | ||
} | ||
|
||
//do not generate extra load on Nexus with new staging repository if signing fails | ||
val initializeSonatypeStagingRepository by tasks.existing | ||
subprojects { | ||
initializeSonatypeStagingRepository { | ||
shouldRunAfter(tasks.withType<Sign>()) | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
|
||
###################################################################################################### | ||
# | ||
# This deploy script requires have all the necessary gradle properties already set up: | ||
# - signing.keyId | ||
# - signing.password | ||
# - signing.secretKeyRingFile | ||
# - sonatype.url | ||
# - sonatype.username | ||
# - sonatype.password | ||
# | ||
###################################################################################################### | ||
|
||
# Stop script on errors or undefined vars | ||
set -euo pipefail; | ||
|
||
readonly SCRIPT_NAME="$(basename "$0")" | ||
readonly green="\e[0;32m" | ||
readonly red="\e[0;31m" | ||
readonly reset="\e[0m" | ||
|
||
if [ $# -lt 1 ]; then | ||
echo | ||
echo "Usage:" | ||
echo -e "${green}$SCRIPT_NAME <version> [optional tag message]${reset}" | ||
exit 1 | ||
fi | ||
|
||
readonly version="$1" | ||
|
||
# default tag message | ||
tag_message="$version release" | ||
|
||
if [ -n "${2-}" ]; then | ||
tag_message="$2" | ||
fi | ||
|
||
echo -e "${green}Building and uploading release ...${reset}" | ||
./gradlew clean build publishToSonatype | ||
|
||
echo -e "${green}Closing sonatype staging repository ...${reset}" | ||
./gradlew closeSonatypeStagingRepository | ||
|
||
echo -e "${green}Pushing version tag ...${reset}" | ||
git tag -a "${version}" -m "${tag_message}" && \ | ||
git push --tags | ||
|
||
# fix version in README.md if needed | ||
echo -e "${green}Setting version in README.md to $version ...${reset}" | ||
sed -E "s/\"com.infinum:retrofit-converter-thrifty:[\.0-9]+\"/\"com.infinum:retrofit-converter-thrifty:$version\"/g" README.md > tmp_readme && mv tmp_readme README.md | ||
|
||
# show changes so we know to commit if needed | ||
echo -e "${green}\nHere's the output of git status:\n${reset}" | ||
git status | ||
|
||
echo -e "${red}\n\nDON'T FORGET to release the artifact on https://oss.sonatype.org/#stagingRepositories !\n${reset}" |
Oops, something went wrong.