Skip to content

Commit

Permalink
Sonatype release (#149)
Browse files Browse the repository at this point in the history
* Added call to close and release repository. Fixes #148

* Swap over to different publishing plugin.

* Missed plugin during the swap.

* Added path to download the plugin.

* Corrected the plugin.

* Comment out maven-publish

* Comment out repositories.

* Missed a bracket.

* Change runtime to match.

* Missed the } again.

* Set the staging id.

* Correcting syntax error.

* Corrected Syntax error.

* Comment out SwimRuntimePublish

* Disable testing for now.

* Disable SwimRuntimePublis on swim.actor.

* Disable include of SwimRuntimePublish in the project build.gradle files.

* Disable include of SwimRuntimePublish in the project build.gradle files.

* Disable include of SwimRuntimePublish in the project build.gradle files.

* Disable include of SwimRuntimePublish in the project build.gradle files.

* Enable tests and restrict release to main and numbered branches.

* Write out the date for a snapshot.

* Append the git commit to the pom.

* Corrected the environment.

* Add the git commit.

* Set the environment.

* Comment out the staging profile

* hard set the url.

* hard set the url.

* Move to run out of the swim-runtime directory.

* Reenable SwimPublish on all sub modules
Move the nexus tasks to the top-level build.gradle- attempt to bypass the issue with the plugin not supporting modular projects

* Only build on the proper branches. Enable testing.

---------

Co-authored-by: ajay-gov <[email protected]>
  • Loading branch information
jcustenborder and ajay-gov committed Sep 29, 2023
1 parent 50d1904 commit e6009a1
Show file tree
Hide file tree
Showing 64 changed files with 136 additions and 112 deletions.
34 changes: 23 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pipeline {
steps {
container('java') {
dir('swim-java') {
sh "./gradlew build||true" //TODO: Fix this! Intermittent tests must pass.
sh "./gradlew build || true" //TODO: Fix this! Intermittent tests must pass.
}
}
}
Expand All @@ -178,22 +178,33 @@ pipeline {
}

stage('release-java') {
// when {
// anyOf {
// branch 'main';
// branch pattern: "^\\d+.\\d+.\\d+", comparator: "REGEXP"
// }
// }
when {
anyOf {
branch 'main';
branch pattern: "^\\d+.\\d+.\\d+", comparator: "REGEXP"
}
}
environment {
ORG_GRADLE_PROJECT_signingKey = credentials("jenkins-gpg-key")
ORG_GRADLE_PROJECT_signingPassword = credentials("jenkins-gpg-key-password")
ORG_GRADLE_PROJECT_gitCommit="${env.GIT_COMMIT}"
}
steps {
container('java') {
withCredentials([usernamePassword(credentialsId: 'sonatype-swim', passwordVariable: 'password', usernameVariable: 'username')]) {
withEnv(["ORG_GRADLE_PROJECT_swimUsername=${username}", "ORG_GRADLE_PROJECT_swimPassword=${password}"]) {
withCredentials([
usernamePassword(credentialsId: 'sonatype-swim', passwordVariable: 'password', usernameVariable: 'username'),
string(credentialsId: 'sonatype-swim-repository', variable: 'stagingProfileId')
]) {
withEnv([
"ORG_GRADLE_PROJECT_swimUsername=${username}",
"ORG_GRADLE_PROJECT_swimPassword=${password}",
"ORG_GRADLE_PROJECT_swimStagingProfileId=${stagingProfileId}",
]) {
dir('swim-java') {
sh "./gradlew publish"
sh "date"
sh "./gradlew publishToSonatype"
sh "./gradlew findSonatypeStagingRepository closeSonatypeStagingRepository"
sh "./gradlew findSonatypeStagingRepository releaseSonatypeStagingRepository"
}
}
}
Expand Down Expand Up @@ -231,4 +242,5 @@ pipeline {
}

}
}
}

23 changes: 23 additions & 0 deletions swim-java/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
buildscript {
dependencies {
classpath("io.github.gradle-nexus:publish-plugin:2.0.0-rc-1")
}
}

plugins {
id 'SwimOSFramework'
id 'SwimOSPublish'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}

description = 'SwimOS'
Expand Down Expand Up @@ -125,3 +132,19 @@ def localizeDependencies(subproject) {
}
}
}

if (project.hasProperty('swimUsername') &&
project.hasProperty('swimPassword') &&
project.hasProperty('swimStagingProfileId')) {
nexusPublishing {
repositories {
sonatype {
username = swimUsername
password = swimPassword
nexusUrl = uri("https://oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://oss.sonatype.org/content/repositories/snapshots/")
// stagingProfileId = swimStagingProfileId
}
}
}
}
38 changes: 11 additions & 27 deletions swim-java/buildSrc/src/main/groovy/SwimOSPublish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ publishing {
name = project.name
description = project.description
url = project.homepage
if(project.hasProperty('gitCommit')) {
properties = [
"git.commit": gitCommit
]
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
Expand All @@ -39,36 +44,15 @@ publishing {
}
}
}

repositories {
if (project.hasProperty('swimUsername') && project.hasProperty('swimPassword')) {
maven {
def releasesRepositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
name = 'Sonatype'
url = isReleaseVersion ? releasesRepositoryUrl : snapshotsRepositoryUrl
credentials {
username swimUsername
password swimPassword
}
}
}
//if (project.hasProperty('githubUsername') && project.hasProperty('githubPassword')) {
// maven {
// name = 'GitHub'
// url = 'https://maven.pkg.github.com/swimos/swim'
// credentials {
// username githubUsername
// password githubPassword
// }
// }
//}
}
}

if (isReleaseVersion) {

//if (isReleaseVersion) {
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
required { gradle.taskGraph.hasTask('publish') }
sign publishing.publications.mavenJava
}
}
//}
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeFramework'
id 'SwimRuntimePublish'
// id 'SwimRuntimePublish'
}

description = 'Swim Runtime'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ publishing {
name = project.name
description = project.description
url = project.homepage
if(project.hasProperty('gitCommit')) {
properties = [
"git.commit": gitCommit
]
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
Expand All @@ -40,19 +45,19 @@ publishing {
}
}

repositories {
if (project.hasProperty('swimUsername') && project.hasProperty('swimPassword')) {
maven {
def releasesRepositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
name = 'Sonatype'
url = isReleaseVersion ? releasesRepositoryUrl : snapshotsRepositoryUrl
credentials {
username swimUsername
password swimPassword
}
}
}
// repositories {
// if (project.hasProperty('swimUsername') && project.hasProperty('swimPassword')) {
// maven {
// def releasesRepositoryUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
// def snapshotsRepositoryUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
// name = 'Sonatype'
// url = isReleaseVersion ? releasesRepositoryUrl : snapshotsRepositoryUrl
// credentials {
// username swimUsername
// password swimPassword
// }
// }
// }
//if (project.hasProperty('githubUsername') && project.hasProperty('githubPassword')) {
// maven {
// name = 'GitHub'
Expand All @@ -63,7 +68,7 @@ publishing {
// }
// }
//}
}
// }
}

//if (isReleaseVersion) {
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeFramework'
id 'SwimRuntimePublish'

}

description = 'Swim Core Framework'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.args/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Composable command line argument parser'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.avro/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Apache Avro codec that incrementally parses and writes swim-structure values'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.codec/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Incremental I/O; functional parsers and writers; display, debug, and diagnostic formatters; and Unicode and binary codecs'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Immutable, structure sharing collections, including hash array mapped tries, finger tries, B-trees, and S-trees (sequence trees)'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Timer, task, and continuation passing style interfaces, with lightweight scheduler and execution stage implementations'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.csv/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Comma-Separated Values (CSV) codec that incrementally parses and writes swim-structure values'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Compiler from swim-structure expressions to live-updated data models'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.db/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Lock-free document store—optimized for high rate atomic state changes—that concurrently commits and compacts on-disk log-structured storage files without blocking parallel in-memory updates to associative B-tree maps, spatial Q-tree maps, sequential S-tree lists, and singleton U-tree values'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.deflate/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'DEFLATE codec that incrementally compresses and decompresses streams'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.http/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'HTTP message model and wire protocol codec that incrementally decodes and encodes HTTP streams without intermediate buffering'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.http2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'HTTP/2 frame model and wire protocol codec that incrementally decodes and encodes HTTP/2 streams without intermediate buffering'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.io.http/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'HTTP client and server socket modems for pipelining and concurrently transporting explicitly flow-controlled HTTP streams over a network without blocking or intermediate buffering'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.io.mqtt/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'MQTT socket modem for concurrently transporting explicitly flow-controlled MQTT streams over a network without blocking or intermediate buffering'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.io.warp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'WARP socket modem for multiplexing and concurrently transporting prioritized, explicitly flow-controlled WARP treams over a network, without blocking or intermediate buffering'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.io.ws/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'WebSocket modem for concurrently transporting explicitly flow-controlled WebSocket streams over a network without blocking or intermediate buffering, and swim-io-http requesters and responders for upgrading HTTP client and server modems to WebSocket modems'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.io/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Explicitly flow-controlled, non-blocking, parallel I/O engine, with swim-codec-modulated socket modems, and TCP and TLS transports'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.json/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'JavaScript Object Notation (JSON) codec that incrementally parses and writes swim-structure values'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.math/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Mathematical and geometric structures, including rings, fields, vector modules and spaces, affine spaces, tensor spaces, probability distributions, and associated operators'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.mqtt/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'MQTT packet model and wire protocol codec that incrementally decodes and encodes MQTT streams without intermediate buffering'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Collection interfaces that notify registered observers of precise state changes'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Protocol Buffers (protobuf) codec that incrementally parses and writes swim-structure values'
Expand Down
2 changes: 1 addition & 1 deletion swim-java/swim-runtime/swim-core/swim.recon/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'SwimRuntimeLibrary'
id 'SwimRuntimePublish'
id 'SwimOSPublish'
}

description = 'Object notation with attributes, like if JSON and XML had a baby'
Expand Down
Loading

0 comments on commit e6009a1

Please sign in to comment.