Skip to content

Commit

Permalink
Merge pull request #17 from wordpress-mobile/add/publish-to-s3
Browse files Browse the repository at this point in the history
Adds publish to S3 Maven using Buildkite
  • Loading branch information
oguzkocer authored Oct 24, 2023
2 parents ff51375 + 18785b8 commit 5af2ad9
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 46 deletions.
23 changes: 23 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
common_params:
# Common plugin settings to use with the `plugins` key.
- &common_plugins
- automattic/a8c-ci-toolkit#2.18.2

agents:
queue: "android"

steps:
- label: "Gradle Wrapper Validation"
command: |
validate_gradle_wrapper
plugins: *common_plugins

# Wait for Gradle Wrapper to be validated before running any other jobs
- wait

- label: "Publish to S3"
plugins: *common_plugins
command: |
./gradlew \
:WordPressLint:prepareToPublishToS3 $(prepare_to_publish_to_s3_params) \
:WordPressLint:publish
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17.0
18 changes: 5 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,13 @@ dependencies {
}
```

## Publish an updated version to your local maven repository
## Publishing a new version

You can bump the [version name in the main build file: `WordPressLint/build.gradle`][1]. After updating the build file, you can build, and publish the library to your local maven repo. That will let you try the new version in your app for example.
In the following cases, the CI will publish a new version with the following format to our remote Maven repo:

```shell
$ ./gradlew assemble test publishToMavenLocal
```

## Publish it to Bintray

When a new version is ready to be published to the remote repository, use the following command to upload it to Bintray:

```shell
$ ./gradlew assemble test bintrayUpload -PbintrayUser=FIXME -PbintrayKey=FIXME -PdryRun=false
```
* For each commit in an open PR: `<PR-number>-<commit full SHA1>`
* Each time a PR is merged to `trunk`: `trunk-<commit full SHA1>`
* Each time a new tag is created: `{tag-name}`

## License ##

Expand Down
21 changes: 14 additions & 7 deletions WordPressLint/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version = "2.0.0"

apply plugin: 'java-library'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'com.android.lint'
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm'
id 'com.android.lint'
id 'maven-publish'
id "com.automattic.android.publish-to-s3"
}

lint {
htmlReport true
Expand All @@ -12,6 +14,11 @@ lint {
ignoreTestSources true
}

repositories {
google()
mavenCentral()
}

dependencies {
compileOnly "com.android.tools.lint:lint-api:$lintVersion"

Expand All @@ -29,7 +36,7 @@ publishing {

groupId = 'org.wordpress'
artifactId = 'lint'
version = project.version
// version is set by 'publish-to-s3' plugin
}
}
}
}
28 changes: 3 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
buildscript {
ext {
kotlinVersion = '1.8.21'
agpVersion = '8.1.0'
lintVersion = '31.1.0'
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:$agpVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}

}

plugins {
id 'maven-publish'
id "com.android.library" apply false
}

allprojects {
repositories {
google()
mavenCentral()
}
ext {
lintVersion = '31.1.0'
}
25 changes: 24 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,24 @@
include ':WordPressLint'
pluginManagement {
gradle.ext.kotlinVersion = '1.8.21'
gradle.ext.agpVersion = '8.1.0'
gradle.ext.automatticPublishToS3Version = '0.9.0'

plugins {
id "org.jetbrains.kotlin.jvm" version gradle.ext.kotlinVersion
id "com.android.library" version gradle.ext.agpVersion
id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version
}
repositories {
maven {
url 'https://a8c-libs.s3.amazonaws.com/android'
content {
includeGroup "com.automattic.android"
includeGroup "com.automattic.android.publish-to-s3"
}
}
gradlePluginPortal()
google()
}
}

include ':WordPressLint'

0 comments on commit 5af2ad9

Please sign in to comment.