Skip to content

Commit cf53561

Browse files
authored
Merge pull request #26 from tumblr/publish-to-s3
Publish to s3
2 parents be2be67 + 9ce1b98 commit cf53561

File tree

4 files changed

+84
-6
lines changed

4 files changed

+84
-6
lines changed

.buildkite/pipeline.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
common-params:
2+
&docker-container
3+
docker#v3.8.0:
4+
image: "public.ecr.aws/automattic/android-build-image:v1.1.0"
5+
propagate-environment: true
6+
environment:
7+
# DO NOT MANUALLY SET THESE VALUES!
8+
# They are passed from the Buildkite agent to the Docker container
9+
- "AWS_ACCESS_KEY"
10+
- "AWS_SECRET_KEY"
11+
12+
steps:
13+
- label: "Lint & Checkstyle"
14+
key: "lint_and_checkstyle"
15+
plugins:
16+
- *docker-container
17+
command: |
18+
./gradlew lintRelease checkstyle
19+
artifact_paths:
20+
- "**/build/reports/lint-results**.*"
21+
- "**/build/reports/checkstyle/checkstyle.*"
22+
23+
- label: "Publish to S3 Maven"
24+
depends_on:
25+
- "lint_and_checkstyle"
26+
plugins:
27+
- *docker-container
28+
command: |
29+
./gradlew \
30+
:backboard:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
31+
:backboard:publish

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
# Backboard
44

5-
[![CircleCI](https://circleci.com/gh/tumblr/Backboard/tree/master.svg?style=svg)](https://circleci.com/gh/tumblr/Backboard/tree/master)
6-
75
A motion-driven animation framework for Android.
86

97
`backboard` is a framework on top of [rebound](http://facebook.github.io/rebound/) that makes it easier to use by coupling it to views and motions.
@@ -19,6 +17,7 @@ A motion-driven animation framework for Android.
1917
## Table of Contents
2018

2119
* [Usage](#usage)
20+
* [Publishing a new version](#publishing-a-new-version)
2221
* [Getting Started](#getting-started)
2322
* [Performers](#performers)
2423
* [Imitators](#imitators)
@@ -32,12 +31,33 @@ A motion-driven animation framework for Android.
3231
Update your `build.gradle` with
3332

3433
```groovy
34+
repositories {
35+
exclusiveContent {
36+
forRepository {
37+
maven {
38+
url "https://a8c-libs.s3.amazonaws.com/android"
39+
}
40+
}
41+
filter {
42+
includeModule "com.tumblr", "backboard"
43+
}
44+
}
45+
}
46+
3547
dependencies {
36-
compile 'com.facebook.rebound:rebound:0.3.8'
37-
compile 'com.tumblr:backboard:0.1.0'
48+
implementation 'com.facebook.rebound:rebound:0.3.8'
49+
implementation 'com.tumblr:backboard:0.2.0'
3850
}
3951
```
4052

53+
## Publishing a new version
54+
55+
In the following cases, the CI will publish a new version with the following format to our S3 Maven repo:
56+
57+
* For each commit in an open PR: `<PR-number>-<commit full SHA1>`
58+
* Each time a PR is merged to `master`: `master-<commit full SHA1>`
59+
* Each time a new tag is created: `{tag-name}`
60+
4161
## Getting Started
4262

4363
Backboard is a framework on top of [rebound](http://facebook.github.io/rebound/) that manages how `Springs` are used and simplifies the

backboard/build.gradle

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins {
22
id "com.android.library"
33
id "checkstyle"
4+
id "com.automattic.android.publish-to-s3"
45
}
56

67
android {
@@ -9,8 +10,6 @@ android {
910
defaultConfig {
1011
minSdkVersion rootProject.ext.minSdkVersion
1112
targetSdkVersion rootProject.ext.targetSdkVersion
12-
versionCode 102
13-
versionName "0.1.2"
1413
}
1514
buildTypes {
1615
release {
@@ -28,6 +27,12 @@ android {
2827
exclude '**/R.java'
2928
}
3029
}
30+
publishing {
31+
singleVariant("release") {
32+
withSourcesJar()
33+
withJavadocJar()
34+
}
35+
}
3136
}
3237

3338
checkstyle {
@@ -66,3 +71,17 @@ dependencies {
6671

6772
implementation fileTree(dir: 'libs', include: ['*.jar'])
6873
}
74+
75+
project.afterEvaluate {
76+
publishing {
77+
publications {
78+
BackboardPublication(MavenPublication) {
79+
from components.release
80+
81+
groupId "com.tumblr"
82+
artifactId "backboard"
83+
// version is set by 'publish-to-s3' plugin
84+
}
85+
}
86+
}
87+
}

settings.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ pluginManagement {
44
plugins {
55
id "com.android.application" version gradle.ext.agpVersion
66
id "com.android.library" version gradle.ext.agpVersion
7+
id "com.automattic.android.publish-to-s3" version "0.7.0"
78
}
89
repositories {
10+
maven {
11+
url 'https://a8c-libs.s3.amazonaws.com/android'
12+
content {
13+
includeGroup "com.automattic.android"
14+
includeGroup "com.automattic.android.publish-to-s3"
15+
}
16+
}
917
google()
1018
mavenCentral()
1119
}

0 commit comments

Comments
 (0)