-
Notifications
You must be signed in to change notification settings - Fork 7
ANDROID-10730 Publishing #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will complete it on a new PR