Skip to content

Commit

Permalink
Merge pull request #941 from wordpress-mobile/publish-to-s3
Browse files Browse the repository at this point in the history
Publish to s3
  • Loading branch information
oguzkocer committed Oct 14, 2021
2 parents 3c76c2d + df3a814 commit 4d1f327
Show file tree
Hide file tree
Showing 14 changed files with 247 additions and 22 deletions.
54 changes: 54 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
common-params:
&publish-android-artifacts-docker-container
docker#v3.8.0:
image: "public.ecr.aws/automattic/android-build-image:v1.1.0"
propagate-environment: true
environment:
# DO NOT MANUALLY SET THESE VALUES!
# They are passed from the Buildkite agent to the Docker container
- "AWS_ACCESS_KEY"
- "AWS_SECRET_KEY"

steps:
- label: "Publish :aztec"
key: "publish-aztec"
plugins:
- *publish-android-artifacts-docker-container
command: |
.buildkite/publish-aztec.sh
- label: "Publish :glide-loader"
key: "publish-glide-loader"
depends_on:
- "publish-aztec"
plugins:
- *publish-android-artifacts-docker-container
command: |
.buildkite/publish-glide-loader.sh
- label: "Publish :picasso-loader"
key: "publish-picasso-loader"
depends_on:
- "publish-aztec"
plugins:
- *publish-android-artifacts-docker-container
command: |
.buildkite/publish-picasso-loader.sh
- label: "Publish :wordpress-shortcodes"
key: "publish-wordpress-shortcodes"
depends_on:
- "publish-aztec"
plugins:
- *publish-android-artifacts-docker-container
command: |
.buildkite/publish-wordpress-shortcodes.sh
- label: "Publish :wordpress-comments"
key: "publish-wordpress-comments"
depends_on:
- "publish-aztec"
plugins:
- *publish-android-artifacts-docker-container
command: |
.buildkite/publish-wordpress-comments.sh
10 changes: 10 additions & 0 deletions .buildkite/publish-aztec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -euo pipefail

./gradlew \
:aztec:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
:aztec:publish

# Add meta-data for the published version so we can use it in subsequent steps
cat ./aztec/build/published-version.txt | buildkite-agent meta-data set "PUBLISHED_AZTEC_VERSION"
11 changes: 11 additions & 0 deletions .buildkite/publish-glide-loader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

# Retrieve data from previous steps
PUBLISHED_AZTEC_VERSION=$(buildkite-agent meta-data get "PUBLISHED_AZTEC_VERSION")

./gradlew \
-PaztecVersion="$PUBLISHED_AZTEC_VERSION" \
:glide-loader:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
:glide-loader:publish
11 changes: 11 additions & 0 deletions .buildkite/publish-picasso-loader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

# Retrieve data from previous steps
PUBLISHED_AZTEC_VERSION=$(buildkite-agent meta-data get "PUBLISHED_AZTEC_VERSION")

./gradlew \
-PaztecVersion="$PUBLISHED_AZTEC_VERSION" \
:picasso-loader:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
:picasso-loader:publish
11 changes: 11 additions & 0 deletions .buildkite/publish-wordpress-comments.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

# Retrieve data from previous steps
PUBLISHED_AZTEC_VERSION=$(buildkite-agent meta-data get "PUBLISHED_AZTEC_VERSION")

./gradlew \
-PaztecVersion="$PUBLISHED_AZTEC_VERSION" \
:wordpress-comments:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
:wordpress-comments:publish
11 changes: 11 additions & 0 deletions .buildkite/publish-wordpress-shortcodes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

# Retrieve data from previous steps
PUBLISHED_AZTEC_VERSION=$(buildkite-agent meta-data get "PUBLISHED_AZTEC_VERSION")

./gradlew \
-PaztecVersion="$PUBLISHED_AZTEC_VERSION" \
:wordpress-shortcodes:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
:wordpress-shortcodes:publish
20 changes: 20 additions & 0 deletions aztec/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "com.android.library"
id "org.jetbrains.kotlin.android"
id "com.automattic.android.publish-to-s3"
}

android {
Expand Down Expand Up @@ -73,3 +74,22 @@ dependencies {

implementation 'org.apache.commons:commons-lang3:3.8.1'
}

project.afterEvaluate {
publishing {
publications {
AztecPublication(MavenPublication) {
from components.release

groupId "org.wordpress"
artifactId "aztec"
// version is set by 'publish-to-s3' plugin
}
}
}
}

publishToS3Plugin {
mavenPublishGroupId "org.wordpress"
mavenPublishArtifactId "aztec"
}
42 changes: 27 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
buildscript {
ext {
gradlePluginVersion = '3.3.1'
kotlinCoroutinesVersion = '1.1.0'
supportLibVersion = '27.1.1'
tagSoupVersion = '1.2.1'
glideVersion = '4.10.0'
picassoVersion = '2.5.2'
robolectricVersion = '4.4'
jUnitVersion = '4.12'
jSoupVersion = '1.11.3'
wordpressUtilsVersion = '1.21'
espressoVersion = '3.0.1'
commonTargetSdkVersion = 30
}
plugins {
id "com.android.application" apply false
id "org.jetbrains.kotlin.android" apply false
}

allprojects {
repositories {
maven {
url "https://a8c-libs.s3.amazonaws.com/android"
content {
includeGroup "org.wordpress"
includeGroup "org.wordpress.aztec"
}
}
google()
jcenter()
}
Expand Down Expand Up @@ -47,3 +42,20 @@ subprojects {
args "-F", "src/**/*.kt"
}
}

ext {
gradlePluginVersion = '3.3.1'
kotlinCoroutinesVersion = '1.1.0'
supportLibVersion = '27.1.1'
tagSoupVersion = '1.2.1'
glideVersion = '4.10.0'
picassoVersion = '2.5.2'
robolectricVersion = '4.4'
jUnitVersion = '4.12'
jSoupVersion = '1.11.3'
wordpressUtilsVersion = '1.21'
espressoVersion = '3.0.1'
commonTargetSdkVersion = 30

aztecProjectDependency = project.hasProperty("aztecVersion") ? "org.wordpress:aztec:${project.getProperty("aztecVersion")}" : project(":aztec")
}
22 changes: 21 additions & 1 deletion glide-loader/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "com.android.library"
id "org.jetbrains.kotlin.android"
id "com.automattic.android.publish-to-s3"
}

android {
Expand All @@ -25,6 +26,25 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$gradle.ext.kotlinVersion"

implementation project(':aztec')
implementation aztecProjectDependency
implementation "com.github.bumptech.glide:glide:$glideVersion"
}

project.afterEvaluate {
publishing {
publications {
GlideLoaderPublication(MavenPublication) {
from components.release

groupId "org.wordpress.aztec"
artifactId "glide-loader"
// version is set by 'publish-to-s3' plugin
}
}
}
}

publishToS3Plugin {
mavenPublishGroupId "org.wordpress.aztec"
mavenPublishArtifactId "glide-loader"
}
3 changes: 0 additions & 3 deletions jitpack.yml

This file was deleted.

22 changes: 21 additions & 1 deletion picasso-loader/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "com.android.library"
id "org.jetbrains.kotlin.android"
id "com.automattic.android.publish-to-s3"
}

android {
Expand All @@ -24,10 +25,29 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$gradle.ext.kotlinVersion"

implementation project(':aztec')
implementation aztecProjectDependency

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'

implementation "com.squareup.picasso:picasso:$picassoVersion"
}

project.afterEvaluate {
publishing {
publications {
PicassoLoaderPublication(MavenPublication) {
from components.release

groupId "org.wordpress.aztec"
artifactId "picasso-loader"
// version is set by 'publish-to-s3' plugin
}
}
}
}

publishToS3Plugin {
mavenPublishGroupId "org.wordpress.aztec"
mavenPublishArtifactId "picasso-loader"
}
8 changes: 8 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ pluginManagement {
id "com.android.library" version gradle.ext.agpVersion
id "com.android.application" version gradle.ext.agpVersion
id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
id "com.automattic.android.publish-to-s3" version "0.6.1"
}
repositories {
maven {
url 'https://a8c-libs.s3.amazonaws.com/android'
content {
includeGroup "com.automattic.android"
includeGroup "com.automattic.android.publish-to-s3"
}
}
gradlePluginPortal()
google()
}
Expand Down
22 changes: 21 additions & 1 deletion wordpress-comments/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "com.android.library"
id "org.jetbrains.kotlin.android"
id "com.automattic.android.publish-to-s3"
}

android {
Expand Down Expand Up @@ -36,7 +37,7 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$gradle.ext.kotlinVersion"

implementation project(':aztec')
implementation aztecProjectDependency

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
Expand All @@ -45,3 +46,22 @@ dependencies {
testImplementation "junit:junit:$jUnitVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
}

project.afterEvaluate {
publishing {
publications {
WordPressCommentsPublication(MavenPublication) {
from components.release

groupId "org.wordpress.aztec"
artifactId "wordpress-comments"
// version is set by 'publish-to-s3' plugin
}
}
}
}

publishToS3Plugin {
mavenPublishGroupId "org.wordpress.aztec"
mavenPublishArtifactId "wordpress-comments"
}
22 changes: 21 additions & 1 deletion wordpress-shortcodes/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "com.android.library"
id "org.jetbrains.kotlin.android"
id "com.automattic.android.publish-to-s3"
}

android {
Expand Down Expand Up @@ -35,10 +36,29 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$gradle.ext.kotlinVersion"

implementation project(':aztec')
implementation aztecProjectDependency

implementation 'androidx.appcompat:appcompat:1.0.0'

testImplementation "junit:junit:$jUnitVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
}

project.afterEvaluate {
publishing {
publications {
WordPressShortcodesPublication(MavenPublication) {
from components.release

groupId "org.wordpress.aztec"
artifactId "wordpress-shortcodes"
// version is set by 'publish-to-s3' plugin
}
}
}
}

publishToS3Plugin {
mavenPublishGroupId "org.wordpress.aztec"
mavenPublishArtifactId "wordpress-shortcodes"
}

0 comments on commit 4d1f327

Please sign in to comment.