Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish

on:
push:
branches:
- main
- 'releases/**'

jobs:
publish:
name: Release build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11

- name: Release build
run: ./gradlew clean build

# Generates other artifacts
- name: Source jar and dokka
run: ./gradlew androidSourcesJar javadocJar

# Runs upload, and then closes & releases the repository
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository

env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
42 changes: 42 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish Snapshot builds


on:
push:
branches:
- development
- 'snapshot/**'




jobs:
publish:
name: Snapshot build and publish
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: adopt
java-version: 11
- name: Release build

run: ./gradlew clean build
- name: Source jar and dokka
run: ./gradlew androidSourcesJar javadocJar
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository



env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}
SNAPSHOT: true
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Change Log
==========


Version 1.0.4 *(28-02-2022)*
----------------------------

* Migration to maven central

Version 1.0.3 *(26-06-2018)*
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ buildscript {
}

dependencies {
classpath 'nz.co.trademe.includeme:includeme:1.0.3'
classpath 'nz.co.trademe.includeme:includeme:1.0.4'
}
}

Expand Down
33 changes: 21 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
ext {
name = "IncludeMe"
}

apply from: 'common.gradle'
apply plugin: 'io.github.gradle-nexus.publish-plugin'
apply plugin: 'org.jetbrains.dokka'

buildscript {
apply from: 'common.gradle'

repositories {
maven { url "https://plugins.gradle.org/m2/" }
google()
jcenter()
}
dependencies {
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintray_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath 'org.jetbrains.dokka:dokka-gradle-plugin:1.6.10'
}
}



apply from: "${rootDir}/publish-root.gradle"

ext {
PUBLISH_VERSION = rootVersionName
ARTIFACT_ID = "includeme"
}

apply plugin: 'java-gradle-plugin'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
Expand All @@ -31,19 +40,18 @@ gradlePlugin {
}
}

sourceCompatibility = 1.8

repositories {
google()
jcenter()
}


dependencies {
compile gradleApi()
compile "com.android.tools.build:gradle:$agp_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation gradleApi()
implementation "com.android.tools.build:gradle:$agp_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"

testCompile 'junit:junit:4.12'
testImplementation'junit:junit:4.12'
}


Expand All @@ -66,4 +74,5 @@ compileKotlin {
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
}

12 changes: 9 additions & 3 deletions common.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
ext.version = "1.0.3"
ext.version = "1.0.4"
ext.group = "nz.co.trademe.includeme"
ext.repo = "includeme"
ext.scm = 'https://github.com/TradeMe/IncludeMe.git'
ext.description = 'A Gradle plugin that simplifies working with composite builds'

ext.connection = 'scm:git:github.com/TradeMe/IncludeMe.git'
ext.developerConnection = 'scm:git:ssh://github.com/TradeMe/IncludeMe.git'
ext.url = 'https://github.com/TradeMe/IncludeMe'


ext.bintray_version = '1.7.3'
ext.kotlin_version = '1.2.30'
ext.agp_version = "3.0.1"
ext.kotlin_version = '1.5.0'
ext.agp_version = "4.0.1"
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
49 changes: 49 additions & 0 deletions publish-root.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

// Create variables with empty default values
ext["signing.keyId"] = ''
ext["signing.password"] = ''
ext["signing.key"] = ''
ext["ossrhUsername"] = ''
ext["ossrhPassword"] = ''
ext["sonatypeStagingProfileId"] = ''
ext["snapshot"] = 'true'

File secretPropsFile = project.rootProject.file('local.properties')
if (secretPropsFile.exists()) {
// Read local.properties file first if it exists
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is -> p.load(is) }
p.each { name, value -> ext[name] = value }
} else {
// Use system environment variables
ext["ossrhUsername"] = System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = System.getenv('OSSRH_PASSWORD')
ext["sonatypeStagingProfileId"] = System.getenv('SONATYPE_STAGING_PROFILE_ID')
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSWORD')
ext["signing.key"] = System.getenv('SIGNING_KEY')
ext["snapshot"] = System.getenv('SNAPSHOT')
}

if (Boolean.parseBoolean(snapshot)) {
ext["rootVersionName"] = project.ext.version + "-SNAPSHOT"
} else {
ext["rootVersionName"] = project.ext.version
}

// Set up Sonatype repository
nexusPublishing {
repositories {
sonatype {
useStaging.set(provider {
!Boolean.parseBoolean(snapshot)
})
version = rootVersionName
stagingProfileId = sonatypeStagingProfileId
username = ossrhUsername
password = ossrhPassword
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
Loading