-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Telefonica/publishing
ANDROID-10730 Publishing
- Loading branch information
Showing
10 changed files
with
303 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
changelog: | ||
exclude: | ||
labels: | ||
- ignore-for-release | ||
authors: | ||
- tuentisre | ||
categories: | ||
- title: Breaking Changes 🛠 | ||
labels: | ||
- breaking-change | ||
- title: New Features 🎉 | ||
labels: | ||
- enhancement | ||
- new-feature | ||
- title: Other Changes | ||
labels: | ||
- "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "Release manually" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
libraryVersion: | ||
description: "Library version" | ||
required: true | ||
jobs: | ||
manual-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build library | ||
run: 'bash ./gradlew clean :nestedscrollwebview:assembleRelease' | ||
|
||
- name: Release library manually | ||
env: | ||
MOBILE_MAVENCENTRAL_USER: ${{ secrets.MOBILE_MAVENCENTRAL_USER }} | ||
MOBILE_MAVENCENTRAL_PASSWORD: ${{ secrets.MOBILE_MAVENCENTRAL_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }} | ||
run: "bash ./gradlew publishReleasePublicationToSonatypeRepository -DLIBRARY_VERSION=${{ github.event.inputs.libraryVersion }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: "Create release" | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build library | ||
run: 'bash ./gradlew clean :nestedscrollwebview:assembleRelease' | ||
|
||
- name: Release library | ||
env: | ||
MOBILE_MAVENCENTRAL_USER: ${{ secrets.MOBILE_MAVENCENTRAL_USER }} | ||
MOBILE_MAVENCENTRAL_PASSWORD: ${{ secrets.MOBILE_MAVENCENTRAL_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }} | ||
run: "bash ./gradlew publishReleasePublicationToSonatypeRepository -DLIBRARY_VERSION=${{ github.event.release.tag_name }}" | ||
|
||
- name: Wait 1 minute until the artifacts are ready in maven central | ||
run: sleep 60s | ||
shell: bash | ||
|
||
- name: Close and promote staging repository | ||
env: | ||
MOBILE_MAVENCENTRAL_USER: ${{ secrets.MOBILE_MAVENCENTRAL_USER }} | ||
MOBILE_MAVENCENTRAL_PASSWORD: ${{ secrets.MOBILE_MAVENCENTRAL_PASSWORD }} | ||
run: 'bash ./gradlew closeAndReleaseRepository' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: "Snapshot" | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
snapshotVersion: | ||
description: "Snapshot version" | ||
required: true | ||
jobs: | ||
snapshot: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build library | ||
run: 'bash ./gradlew clean :nestedscrollwebview:assembleRelease' | ||
|
||
- name: Release snapshot | ||
env: | ||
MOBILE_MAVENCENTRAL_USER: ${{ secrets.MOBILE_MAVENCENTRAL_USER }} | ||
MOBILE_MAVENCENTRAL_PASSWORD: ${{ secrets.MOBILE_MAVENCENTRAL_PASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEYID }} | ||
run: "bash ./gradlew publishReleasePublicationToSonatypeRepository -DSNAPSHOT_VERSION=${{ github.event.inputs.snapshotVersion }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Tests | ||
on: pull_request | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2.3.5 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
## Build all our Build Types at once ## | ||
- name: Build all artifacts | ||
id: buildAllApks | ||
uses: eskatos/gradle-command-action@v1.3.3 | ||
with: | ||
gradle-version: current | ||
wrapper-cache-enabled: false | ||
dependencies-cache-enabled: false | ||
configuration-cache-enabled: false | ||
arguments: assembleRelease check detekt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
# android-nested-scroll-webview | ||
<p> | ||
<img src="https://img.shields.io/badge/Platform-Android-brightgreen" /> | ||
<img src="https://maven-badges.herokuapp.com/maven-central/com.telefonica/nestedscrollwebview/badge.png" /> | ||
<img src="https://img.shields.io/badge/Support-%3E%3D%20Android%205.0-brightgreen" /> | ||
</p> | ||
|
||
# Android Nested Scroll WebView | ||
|
||
Android WebView implementation for nested scrolling layouts | ||
|
||
To include the library add to your app's `build.gradle`: | ||
|
||
```gradle | ||
implementation 'com.telefonica:nestedscrollwebview:{version}' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,49 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
buildscript { | ||
dependencies { | ||
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0" | ||
} | ||
} | ||
|
||
plugins { | ||
id 'com.android.application' version '7.2.1' apply false | ||
id 'com.android.library' version '7.2.1' apply false | ||
id 'com.android.application' version '7.2.2' apply false | ||
id 'com.android.library' version '7.2.2' apply false | ||
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false | ||
id 'io.gitlab.arturbosch.detekt' version '1.18.1' | ||
} | ||
|
||
detekt { | ||
input = files(rootProject.rootDir) | ||
config = files("$projectDir/detekt.yml") | ||
failFast = true | ||
buildUponDefaultConfig = true | ||
|
||
reports { | ||
html.enabled = true | ||
xml.enabled = true | ||
xml.destination = file("$buildDir/reports/detekt/detekt-checkstyle.xml") | ||
html.destination = file("$buildDir/reports/detekt/detekt-report.html") | ||
} | ||
} | ||
|
||
task clean(type: Delete) { | ||
delete rootProject.buildDir | ||
} | ||
|
||
apply plugin: 'io.codearte.nexus-staging' | ||
|
||
nexusStaging { | ||
packageGroup = "com.telefonica" | ||
stagingProfileId = "f7fe7699e57a" | ||
username = System.getenv("MOBILE_MAVENCENTRAL_USER") | ||
password = System.getenv("MOBILE_MAVENCENTRAL_PASSWORD") | ||
} | ||
|
||
allprojects { | ||
group = 'com.telefonica.nestedscrollwebview' | ||
if (System.getProperty("SNAPSHOT_VERSION") != null) { | ||
version = System.getProperty("SNAPSHOT_VERSION")+"-SNAPSHOT" | ||
} else { | ||
version = System.getProperty("LIBRARY_VERSION") ?: "undefined" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
build: | ||
maxIssues: 0 | ||
weights: | ||
complexity: 2 | ||
formatting: 1 | ||
LongParameterList: 1 | ||
comments: 1 | ||
|
||
complexity: | ||
TooManyFunctions: | ||
active: false | ||
LongMethod: | ||
active: false | ||
LongParameterList: | ||
active: false | ||
|
||
empty-blocks: | ||
EmptyFunctionBlock: | ||
active: false | ||
style: | ||
MagicNumber: | ||
active: false | ||
NewLineAtEndOfFile: | ||
active: false | ||
UnusedPrivateMember: | ||
active: false | ||
WildcardImport: | ||
active: false | ||
|
||
exceptions: | ||
TooGenericExceptionThrown: | ||
active: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
task sourcesJar(type: Jar) { | ||
archiveClassifier.set('sources') | ||
from android.sourceSets.main.java.srcDirs | ||
} | ||
|
||
artifacts { | ||
archives sourcesJar | ||
} | ||
|
||
apply plugin: 'maven-publish' | ||
apply plugin: 'signing' | ||
|
||
ext { | ||
PUBLISH_GROUP_ID = 'com.telefonica' | ||
PUBLISH_ARTIFACT_ID = 'nestedscrollwebview' | ||
PUBLISH_VERSION = version | ||
|
||
PUBLISH_RELEASE_NAME = 'Nested Scroll WebView for Android' | ||
PUBLISH_DESCRIPTION = 'A webView implementation with nested scrolling support' | ||
PUBLISH_REPO_URL = 'https://github.com/Telefonica/android-nested-scroll-webview' | ||
} | ||
|
||
publishing { | ||
publications { | ||
release(MavenPublication) { | ||
groupId PUBLISH_GROUP_ID | ||
artifactId PUBLISH_ARTIFACT_ID | ||
version PUBLISH_VERSION | ||
|
||
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar") | ||
artifact sourcesJar | ||
|
||
pom { | ||
name = PUBLISH_RELEASE_NAME | ||
description = PUBLISH_DESCRIPTION | ||
url = PUBLISH_REPO_URL | ||
licenses { | ||
license { | ||
name = 'The Apache License, Version 2.0' | ||
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' | ||
} | ||
} | ||
developers { | ||
developer { | ||
id = 'android-team-telefonica' | ||
name = 'Android Team' | ||
email = 'cto-android@telefonica.com' | ||
} | ||
} | ||
scm { | ||
connection = 'scm:git:https://github.com/Telefonica/android-nested-scroll-webview.git' | ||
developerConnection = 'scm:git:ssh://https://github.com/Telefonica/android-nested-scroll-webview.git' | ||
url = 'https://github.com/Telefonica/android-nested-scroll-webview/tree/main' | ||
} | ||
withXml { | ||
def dependenciesNode = asNode().appendNode('dependencies') | ||
|
||
project.configurations.getByName("implementation").allDependencies.each { | ||
def dependencyNode = dependenciesNode.appendNode('dependency') | ||
dependencyNode.appendNode('groupId', it.group) | ||
dependencyNode.appendNode('artifactId', it.name) | ||
dependencyNode.appendNode('version', it.version) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
repositories { | ||
maven { | ||
name = "sonatype" | ||
|
||
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" | ||
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" | ||
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl | ||
credentials { | ||
username System.getenv("MOBILE_MAVENCENTRAL_USER") | ||
password System.getenv("MOBILE_MAVENCENTRAL_PASSWORD") | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
def signingKeyId = findProperty("signingKeyId") | ||
def signingKey = findProperty("signingKey") | ||
def signingPassword = findProperty("signingPassword") | ||
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) | ||
sign publishing.publications | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters