-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Realease Attach artifacts to Maven Central (#99)
- Loading branch information
1 parent
72dcf6c
commit 4516fc7
Showing
7 changed files
with
59 additions
and
43 deletions.
There are no files selected for viewing
File renamed without changes.
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Exit immediately if any command in the script fails | ||
set -e | ||
|
||
# Configure GIT | ||
git config --global user.name "Gluon Bot" | ||
git config --global user.email "[email protected]" | ||
|
||
# Decrypt encrypted files | ||
openssl aes-256-cbc -K $encrypted_dc87922a4c8c_key -iv $encrypted_dc87922a4c8c_iv -in .ci/secring.gpg.enc -out secring.gpg -d | ||
if [[ ! -s secring.gpg ]] | ||
then echo "Decryption failed." | ||
exit 1 | ||
fi | ||
|
||
# Release artifacts | ||
./gradlew publish closeAndReleaseRepository -i -PsonatypeUsername=$SONATYPE_USERNAME -PsonatypePassword=$SONATYPE_PASSWORD -Psigning.keyId=$GPG_KEYNAME -Psigning.password=$GPG_PASSPHRASE -Psigning.secretKeyRingFile=secring.gpg | ||
|
||
# Update version by 1 | ||
newVersion=${TRAVIS_TAG%.*}.$((${TRAVIS_TAG##*.} + 1)) | ||
|
||
# Update project version to next snapshot version | ||
sed -i -z "0,/version = $TRAVIS_TAG/s//version = $newVersion-SNAPSHOT/" gradle.properties | ||
|
||
git commit gradle.properties -m "Prepare development of $newVersion" | ||
git push https://gluon-bot:$GITHUB_PASSWORD@github.com/$TRAVIS_REPO_SLUG HEAD:master |
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
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,2 +1,5 @@ | ||
group = com.gluonhq.attach | ||
version = 4.0.7-SNAPSHOT | ||
|
||
# disable publish of sha256, sha512 | ||
systemProp.org.gradle.internal.publish.checksums.insecure=true |
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,6 +1,9 @@ | ||
import java.time.Duration | ||
|
||
apply plugin: 'java' | ||
apply plugin: 'maven-publish' | ||
//apply plugin: 'signing' | ||
apply plugin: 'signing' | ||
apply plugin: 'de.marcphilipp.nexus-publish' | ||
|
||
def nativeLib(buildDir, projectDir, service, osname) { | ||
return tasks.create("nativeLib${service}${osname}") { | ||
|
@@ -110,9 +113,9 @@ publishing { | |
} | ||
|
||
scm { | ||
connection = 'scm:git:https://github.com/tiainen/attach.git' | ||
developerConnection = 'scm:git:ssh://[email protected]/tiainen/attach.git' | ||
url = 'https://github.com/tiainen/attach' | ||
connection = 'scm:git:https://github.com/gluonhq/attach.git' | ||
developerConnection = 'scm:git:ssh://[email protected]/gluonhq/attach.git' | ||
url = 'https://github.com/gluonhq/attach' | ||
} | ||
} | ||
|
||
|
@@ -126,25 +129,12 @@ publishing { | |
} | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
// to upload release, use: | ||
// ./gradlew -PrepositoryUrl=https://oss.sonatype.org/service/local/staging/deploy/maven2 publish | ||
// url = getStringProperty('repositoryUrl', 'https://oss.sonatype.org/content/repositories/snapshots/') | ||
url = getStringProperty('repositoryUrl', 'https://nexus.gluonhq.com/nexus/content/repositories/public-snapshots/') | ||
credentials { | ||
username = getStringPropertyDefaultAsProperty('repositoryUsername', 'gluonNexusUsername') | ||
password = getStringPropertyDefaultAsProperty('repositoryPassword', 'gluonNexusPassword') | ||
} | ||
} | ||
} | ||
} | ||
|
||
//signing { | ||
// sign publishing.publications.maven | ||
// required = { gradle.taskGraph.hasTask(publish) && !version.endsWith("SNAPSHOT") } | ||
//} | ||
signing { | ||
sign publishing.publications.maven | ||
required = { gradle.taskGraph.hasTask(publish) && !version.endsWith("SNAPSHOT") } | ||
} | ||
|
||
private String getServiceName(projectName) { | ||
if (projectName.contains("-")) { // in-app-billing -> InAppBilling | ||
|
@@ -154,24 +144,11 @@ private String getServiceName(projectName) { | |
return projectName.capitalize() | ||
} | ||
|
||
private String getStringProperty(String name, String defaultValue) { | ||
if (!project.hasProperty(name)) { | ||
return defaultValue | ||
} | ||
|
||
def propertyValue = project.property(name) | ||
return propertyValue != null ? propertyValue.toString().trim() : defaultValue | ||
} | ||
|
||
private String getStringPropertyDefaultAsProperty(String name, String defaultProperty) { | ||
if (!project.hasProperty(name)) { | ||
return project.hasProperty(defaultProperty) ? project.property(defaultProperty) : System.getenv(name) | ||
} | ||
|
||
def propertyValue = project.property(name) | ||
if (propertyValue != null) { | ||
return propertyValue.toString().trim() | ||
} else { | ||
return project.hasProperty(defaultProperty) ? project.property(defaultProperty) : System.getenv(name) | ||
nexusPublishing { | ||
repositories { | ||
sonatype() | ||
} | ||
// credentials are shared from staging plugin | ||
clientTimeout = Duration.ofMinutes(5) | ||
connectTimeout = Duration.ofMinutes(5) | ||
} |