diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6b2a253c2..6392f5692 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,8 +18,11 @@ jobs: - name: Publish package env: - MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - PGP_SECRET: ${{ secrets.SIGNING_KEY }} - PGP_PASSPHRASE: ${{ secrets.SIGNING_PASSWORD }} - run: ./gradlew publish + JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.SIGNING_PUBLIC_KEY }} + JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_SIGNING_KEY }} + JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_SIGNING_PASSWORD }} + JRELEASER_MAVENCENTRAL_SONATYPE_USERNAME: ${{ secrets.OSSRH_USERNAME }} + JRELEASER_MAVENCENTRAL_SONATYPE_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + run: | + ./gradlew publish + ./gradlew jreleaserDeploy diff --git a/.gitignore b/.gitignore index dea3a9d88..da44d7acb 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ classes/ /.settings .classpath .project +.vscode diff --git a/build.gradle b/build.gradle index 0686b5c72..48cd82353 100644 --- a/build.gradle +++ b/build.gradle @@ -9,14 +9,24 @@ plugins { id 'signing' id 'org.owasp.dependencycheck' version '12.1.3' id 'com.gradleup.shadow' version '8.3.7' + id 'org.jreleaser' version '1.19.0' } +ext { + seleniumVersion = project.property('selenium.version') + appiumClientVersion = project.property('appiumClient.version') + slf4jVersion = '2.0.17' +} + +group = 'io.appium' +version = appiumClientVersion + repositories { mavenCentral() if (project.hasProperty("isCI")) { maven { - url uri('https://oss.sonatype.org/content/repositories/snapshots/') + url uri('https://central.sonatype.com/api/v1/publisher') mavenContent { snapshotsOnly() } @@ -31,12 +41,6 @@ java { withSourcesJar() } -ext { - seleniumVersion = project.property('selenium.version') - appiumClientVersion = project.property('appiumClient.version') - slf4jVersion = '2.0.17' -} - dependencies { compileOnly 'org.projectlombok:lombok:1.18.38' annotationProcessor 'org.projectlombok:lombok:1.18.38' @@ -160,23 +164,27 @@ publishing { } repositories { maven { - credentials { - username = System.getenv("MAVEN_USERNAME") - password = System.getenv("MAVEN_PASSWORD") - } - 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 + url = layout.buildDirectory.dir('staging-deploy') } } } -signing { - required { !'true'.equalsIgnoreCase(project.findProperty('signingDisabled')) } - def signingKey = System.getenv("PGP_SECRET") - def signingPassword = System.getenv("PGP_PASSPHRASE") - useInMemoryPgpKeys(signingKey, signingPassword) - sign publishing.publications.mavenJava +jreleaser { + signing { + active = 'ALWAYS' + armored = true + } + deploy { + maven { + mavenCentral { + sonatype { + active = 'ALWAYS' + url = 'https://central.sonatype.com/api/v1/publisher' + stagingRepository('build/staging-deploy') + } + } + } + } } wrapper { diff --git a/docs/release.md b/docs/release.md index f2a6c1ae6..9a84ee016 100644 --- a/docs/release.md +++ b/docs/release.md @@ -9,21 +9,17 @@ Its target auditory is project maintainers. 1. Bump the `appiumClient.version` number in [gradle.properties](../gradle.properties). 1. Create a pull request to approve the changelog and version bump. 1. Merge the pull request after it is approved. -1. Create and push a new repository tag. The tag name should look like - `v..`. -1. Create a new [Release](https://github.com/appium/java-client/releases/new) in GitHub. - Paste the above changelist into the release notes. Make sure the name of the new release - matches to the name of the above tag. -1. Open [Sonatype](https://oss.sonatype.org/#welcome) in your browser. -1. Login to Nexus using 1Password credentials. Ask Appium maintainers - if you need access to the team's 1Password vault. -1. Navigate to `Staging Repositories`. -1. Select the corresponding release and click `Close`. Note that it may take - some minutes until Sonatype picks up the GitHub release. -1. Wait until checks are completed. -1. Click `Release`. -1. After the new release is published, it becomes available in - [Maven Central](https://repo1.maven.org/maven2/io/appium/java-client/) - within 30 minutes. Once artifacts are in Maven Central, it normally - takes 1-2 hours before they appear in - [search results](https://central.sonatype.com/artifact/io.appium/java-client). +1. Create and push a new repository tag. The tag name should look like + `v..`. +1. Create a new [Release](https://github.com/appium/java-client/releases/new) in GitHub. + Paste the above changelist into the release notes. Make sure the name of the new release + matches to the name of the above tag. +1. Open [Maven Central Repository](https://central.sonatype.com/) in your browser. +1. Log in to the `Maven Central Repository` using the credentials stored in 1Password. If you need access to the team's 1Password vault, contact the Appium maintainers. +1. Navigate to the `Publish` section. +1. Under `Deployments`, you will see the latest deployment being published. Note: Sometimes the status may remain in the `publishing` state for an extended period, but it will eventually complete. +1. After the new release is published, it becomes available in + [Maven Central](https://repo1.maven.org/maven2/io/appium/java-client/) + within 30 minutes. Once artifacts are in Maven Central, it normally + takes 1-2 hours before they appear in + [search results](https://central.sonatype.com/artifact/io.appium/java-client).