diff --git a/airbyte-server/build.gradle b/airbyte-server/build.gradle index 9ea1d34ca381..1b083e15ed46 100644 --- a/airbyte-server/build.gradle +++ b/airbyte-server/build.gradle @@ -1,28 +1,5 @@ plugins { id 'application' - id 'maven-publish' - id 'com.github.johnrengelman.shadow' version '6.1.0' -} - -shadowJar { - zip64 true - mergeServiceFiles() - exclude 'META-INF/*.RSA' - exclude 'META-INF/*.SF' - exclude 'META-INF/*.DSA' - // Not stubbing this out adds 'all' to the end of the jar's name. - classifier = '' -} - -publishing { - publications { - shadow(MavenPublication) { publication -> - project.shadow.component(publication) - } - } - repositories { - mavenLocal() - } } dependencies { diff --git a/build.gradle b/build.gradle index 89f5e7ba9f44..36ea497cb63e 100644 --- a/build.gradle +++ b/build.gradle @@ -290,3 +290,49 @@ tasks.withType(AbstractArchiveTask) { preserveFileTimestamps = false reproducibleFileOrder = true } + +// Configure what Subprojects to publish. +String[] toPublish = [ + ':airbyte-analytics', + ':airbyte-api', + ':airbyte-commons', + ':airbyte-commons-docker', + ':airbyte-config:init', + ':airbyte-config:models', + ':airbyte-config:persistence', + ':airbyte-db', + ':airbyte-json-validation', + ':airbyte-json-notification', + ':airbyte-protocol:models', + ':airbyte-scheduler:models', + ':airbyte-scheduler:client', + ':airbyte-scheduler:persistence', + ':airbyte-server', + ':airbyte-workers' +] +configure(subprojects.findAll { toPublish.contains(it.getPath()) }) { + apply plugin: 'maven-publish' + + publishing { + repositories { + publications { + // This block is present so Gradle knows to publish a Maven jar. + maven(MavenPublication) { + // Gradle will by default use the subproject path as the group id and the subproject name as the artifact id. + // e.g. the subproject :airbyte-scheduler:models is imported at io.airbyte.airbyte-config:persistence:. + } + } + + maven { + credentials { + name 'cloudrepo' + username System.getenv('CLOUDREPO_USER') + password System.getenv('CLOUDREPO_PASSWORD') + } + url 'https://airbyte.mycloudrepo.io/repositories/airbyte-public-jars' + } + + mavenLocal() + } + } +} diff --git a/tools/bin/release_version.sh b/tools/bin/release_version.sh index 5f93576375e5..8947a48af839 100755 --- a/tools/bin/release_version.sh +++ b/tools/bin/release_version.sh @@ -11,6 +11,16 @@ if [[ "$BRANCH" == "master" ]]; then exit 1; fi +if [[ -z "${CLOUDREPO_USER}" ]]; then + echo 'CLOUDREPO_USER env var not set. Please retrieve the user email from the CloudRepo lastpass secret and run export CLOUDREPO_USER=.'; + exit 1; +fi + +if [[ -z "${CLOUDREPO_PASSWORD}" ]]; then + echo 'CLOUDREPO_PASSWORD env var not set. Please retrieve the user email from the CloudRepo lastpass secret and run export CLOUDREPO_PASSWORD=.'; + exit 1; +fi + PREV_VERSION=$(grep VERSION .env | cut -d"=" -f2) PART_TO_BUMP=$1 @@ -30,6 +40,7 @@ echo "Bumped version from ${PREV_VERSION} to ${NEW_VERSION}" echo "Building and publishing version $NEW_VERSION for git revision $GIT_REVISION..." SUB_BUILD=PLATFORM ./gradlew clean composeBuild +SUB_BUILD=PLATFORM ./gradlew clean publish VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml build VERSION=$NEW_VERSION GIT_REVISION=$GIT_REVISION docker-compose -f docker-compose.build.yaml push echo "Completed building and publishing..."