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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ repositories {
}

dependencies {
implementation("com.lopcode.vips-ffm:vips-ffm-core:1.11.0")
implementation("com.lopcode.vips-ffm:vips-ffm-core:1.11.1")
}
```

Expand Down
24 changes: 21 additions & 3 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ dependencies {}
val githubVersion = System.getenv("GITHUB_VERSION") ?: null
val mavenVersion = githubVersion?.removePrefix("v") ?: "local"
val releasePath = "repos/release-${githubVersion}"
val relocationReleasePath = "repos/relocation-${githubVersion}"

val coreGroupId = "com.lopcode.vips-ffm"
val coreArtifactId = "vips-ffm-core"
Expand Down Expand Up @@ -198,6 +199,11 @@ publishing {
name = "Local"
url = uri(layout.buildDirectory.dir(releasePath))
}
// Maven Central rejects a deployment containing more than one namespace
maven {
name = "LocalRelocation"
url = uri(layout.buildDirectory.dir(relocationReleasePath))
}
}
}

Expand All @@ -216,13 +222,13 @@ if (!signingKey.isNullOrBlank()) {
}

tasks.withType<PublishToMavenRepository>().configureEach {
onlyIf("relocation POMs are only published to Maven Central") {
publication.name != "relocation" || repository.name == "Local"
onlyIf("relocation POMs are only published to their own Maven Central bundle") {
(publication.name == "relocation") == (repository.name == "LocalRelocation")
}
}

tasks.register<Zip>("packageMavenCentralRelease") {
dependsOn("publishMavenJavaPublicationToLocalRepository", "publishRelocationPublicationToLocalRepository")
dependsOn("publishMavenJavaPublicationToLocalRepository")

archiveFileName.set("release-${githubVersion}.zip")
destinationDirectory.set(layout.buildDirectory.dir("repos"))
Expand All @@ -231,4 +237,16 @@ tasks.register<Zip>("packageMavenCentralRelease") {
exclude("*/.*")

from(layout.buildDirectory.dir(releasePath))
}

tasks.register<Zip>("packageMavenCentralRelocation") {
dependsOn("publishRelocationPublicationToLocalRelocationRepository")

archiveFileName.set("relocation-${githubVersion}.zip")
destinationDirectory.set(layout.buildDirectory.dir("repos"))

// exclude hidden files
exclude("*/.*")

from(layout.buildDirectory.dir(relocationReleasePath))
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ <h2 id="usage-heading">Usage</h2>
}

dependencies {
implementation(&quot;com.lopcode.vips-ffm:vips-ffm-core:1.11.0&quot;)
implementation(&quot;com.lopcode.vips-ffm:vips-ffm-core:1.11.1&quot;)
}
</code></pre>
<p>Please note that the package has relocated from <code>app.photofox.vips-ffm</code> to <code>com.lopcode.vips-ffm</code>. New versions will
Expand Down
20 changes: 14 additions & 6 deletions publish_release_to_maven_central.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ git describe --exact-match --tags

SIGNING_KEY_ID=$(op read "op://Private/Sonatype GPG/key id") \
SIGNING_KEY_PASSPHRASE=$(op read "op://Private/Sonatype GPG/password") \
./gradlew clean core:compileJava core:packageMavenCentralRelease
./gradlew clean core:compileJava core:packageMavenCentralRelease core:packageMavenCentralRelocation

MAVEN_CENTRAL_USER=$(op read "op://Private/New Maven Central Portal Publish/username")
MAVEN_CENTRAL_TOKEN=$(op read "op://Private/New Maven Central Portal Publish/password")
BEARER_TOKEN=$(echo "$MAVEN_CENTRAL_USER:$MAVEN_CENTRAL_TOKEN" | base64)

curl --request POST \
--verbose \
--header "Authorization: Bearer $BEARER_TOKEN" \
--form bundle=@core/build/repos/release-"$GITHUB_VERSION".zip \
https://central.sonatype.com/api/v1/publisher/upload?name="$GITHUB_VERSION"\&publishingType=USER_MANAGED
# Maven Central accepts one namespace per deployment, so each bundle is uploaded separately
upload_bundle() {
echo "Uploading $1 as deployment \"$2\"..."
curl --request POST \
--fail-with-body \
--header "Authorization: Bearer $BEARER_TOKEN" \
--form bundle=@"$1" \
https://central.sonatype.com/api/v1/publisher/upload?name="$2"\&publishingType=USER_MANAGED
echo
}

upload_bundle core/build/repos/release-"$GITHUB_VERSION".zip "$GITHUB_VERSION"
upload_bundle core/build/repos/relocation-"$GITHUB_VERSION".zip "$GITHUB_VERSION-relocation"
Loading