Skip to content
Open
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
30 changes: 11 additions & 19 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 11

# Builds the release artifacts of the library
- name: Release build
run: ./gradlew :espresso:assembleRelease

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

# Runs upload, and then closes & releases the repository
- name: Publish to MavenCentral
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
# Builds + signs the release AAR (with sources/javadoc jars), uploads
# to the Sonatype Central Portal, and auto-releases the deployment.
- name: Publish to Maven Central
run: ./gradlew publishToMavenCentral --max-workers 1 --no-configuration-cache
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 }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id 'com.vanniktech.maven.publish' version '0.30.0' apply false
}
apply from: "${rootDir}/scripts/publish-root.gradle"
42 changes: 36 additions & 6 deletions espresso/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary

plugins {
id 'com.android.library'
id 'com.vanniktech.maven.publish'
}

android {
Expand Down Expand Up @@ -32,10 +35,37 @@ dependencies {
implementation 'androidx.test:core:1.5.0'
}

ext {
PUBLISH_GROUP_ID = 'io.percy'
PUBLISH_VERSION = '1.0.5-beta.0'
PUBLISH_ARTIFACT_ID = 'espresso-java'
}
mavenPublishing {
coordinates('io.percy', 'espresso-java', '1.0.5-beta.0')

// Publish the release AAR with sources + javadoc jars (javadoc jar is
// required by Maven Central release validation).
configure(new AndroidSingleVariantLibrary('release', true, true))

apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
// Central Portal is the default host; `true` auto-releases the deployment
// after upload (replaces the old close-and-release Nexus step).
publishToMavenCentral(true)
signAllPublications()

pom {
name = 'espresso-java'
description = 'App Percy official espresso SDK'
url = 'https://github.com/percy/percy-espresso-java'
licenses {
license {
name = 'MIT License'
url = 'https://github.com/percy/percy-espresso-java/blob/main/LICENSE'
}
}
developers {
developer {
name = 'Team Browserstack'
}
}
scm {
connection = 'scm:git:github.com/percy/percy-espresso-java.git'
developerConnection = 'scm:git:ssh://github.com/percy/percy-espresso-java.git'
url = 'https://github.com/percy/percy-espresso-java/tree/main'
}
}
}
73 changes: 0 additions & 73 deletions scripts/publish-module.gradle

This file was deleted.

35 changes: 0 additions & 35 deletions scripts/publish-root.gradle

This file was deleted.

Loading