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
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
os: [ubuntu-latest]
java-distribution: [adopt]
java-version: [8]
java-version: [11]
dockcross-only:
[
"android-arm",
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
matrix:
os: [macos-latest]
java-distribution: [adopt]
java-version: [8]
java-version: [11]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -193,13 +193,13 @@ jobs:

- name: Publish to Sonatype OSSRH (Maven Central)
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
# OSSRH_STAGING_PROFILE_ID: ${{ secrets.OSSRH_STAGING_PROFILE_ID }}
run: ./gradlew publishAndReleaseToMavenCentral -Ph3GithubArtifactsUse=true -Ph3GithubArtifactsByRun=true

- name: Create GitHub Release (with changelog notes)
# This uses an action to create a release on GitHub
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
os: [ubuntu-latest]
java-distribution: [adopt]
java-version: [8, 11, 17, 21, 22]
java-version: [11, 17, 21, 22]
dockcross-only: ["android-arm", "android-arm64", "linux-arm64", "linux-armv5", "linux-armv7", "linux-s390x", "linux-ppc64le", "linux-x64", "linux-x86", "windows-static-x64", "windows-static-x86"]

steps:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:

- uses: actions/upload-artifact@v4
name: Upload artifacts
if: ${{ matrix.java-version == 8 }}
if: ${{ matrix.java-version == 11 }}
with:
name: docker-built-shared-objects-${{ matrix.dockcross-only }}
path: |
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
# TODO: Windows pinned back
os: [macos-latest, windows-2022]
java-distribution: [adopt]
java-version: [8, 11, 17, 21, 22]
java-version: [11, 17, 21, 22]

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:

- uses: actions/upload-artifact@v4
name: Upload Mac OS Artifacts
if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 8 }}
if: ${{ matrix.os == 'macos-latest' && matrix.java-version == 11 }}
with:
name: macos-built-shared-objects
path: src/main/resources/*/*.dylib
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
matrix:
os: [ubuntu-latest]
java-distribution: [adopt]
java-version: [8]
java-version: [11]

steps:
- uses: actions/checkout@v4
Expand Down
114 changes: 44 additions & 70 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.vanniktech.maven.publish.JavaLibrary
import com.vanniktech.maven.publish.JavadocJar

buildscript {
repositories {
mavenCentral()
Expand All @@ -15,7 +18,7 @@ plugins {
// TODO: Requires Java 11
// id 'com.diffplug.spotless' version '6.25.0'
id 'com.github.nbaztec.coveralls-jacoco' version '1.2.20'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
id 'com.vanniktech.maven.publish' version '0.34.0'
}

group = 'com.uber'
Expand Down Expand Up @@ -117,75 +120,46 @@ sourcesJar {
dependsOn buildH3
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
pom {
name = 'h3'
url = 'https://github.com/uber/h3-java'
description = project.description
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
organization {
name = 'Uber Open Source'
url = 'https://github.com/uber/'
}
scm {
connection = 'scm:git:git://github.com/uber/h3-java.git'
developerConnection = 'scm:git:ssh://git@github.com/uber/h3-java.git'
url = 'http://github.com/uber/h3-java/tree/master'
}
developers {
developer {
id = 'isaacbrodsky'
name = 'Isaac Brodsky'
email = 'isaac@isaacbrodsky.com'
organization = 'Uber Technologies, Inc.'
organizationUrl = 'https://github.com/uber/'
}
}
}
}
}
mavenPublishing {
coordinates(project.group, "h3", project.version)

// repositories {
// maven {
// 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 = project.findProperty('ossrhUsername') ?: ''
// password = project.findProperty('ossrhPassword') ?: ''
// }
// }
// }
}

signing {
// Use in-memory PGP signing keys from environment variables
useInMemoryPgpKeys(
System.getenv("SIGNING_KEY_ID"), // PGP key ID (short format) – optional, can be null
System.getenv("SIGNING_KEY"), // PGP secret key (ASCII-armored, e.g. base64-encoded)
System.getenv("SIGNING_PASSWORD") // PGP key passphrase
)
sign(publishing.publications) // Sign all publications
}

nexusPublishing {
repositories {
sonatype {
// Performance optimization, not needed:
// stagingProfileId.set(System.getenv("OSSRH_STAGING_PROFILE_ID"))
username.set(System.getenv("OSSRH_USERNAME"))
password.set(System.getenv("OSSRH_PASSWORD"))
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
}
pom {
name = "h3"
description = project.description
url = "https://github.com/uber/h3-java"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
organization {
name = 'Uber Open Source'
url = 'https://github.com/uber/'
}
developers {
developer {
id = "isaacbrodsky"
name = "Isaac Brodsky"
email = "isaac@isaacbrodsky.com"
}
}
scm {
url = "http://github.com/uber/h3-java/tree/master"
connection = "scm:git:git://github.com/uber/h3-java.git"
developerConnection = "scm:git:ssh://git@github.com/uber/h3-java.git"
}
}

// the first parameter configures the -javadoc artifact, possible values:
// - `JavadocJar.None()` don't publish this artifact
// - `JavadocJar.Empty()` publish an empty jar
// - `JavadocJar.Javadoc()` to publish standard javadocs
// the second whether to publish a sources jar
configure(new JavaLibrary(new JavadocJar.Javadoc(), true))

publishToMavenCentral()

signAllPublications()
}
Loading