mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-02 22:59:48 +00:00
update publishing way
This commit is contained in:
@@ -15,3 +15,13 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("getPublishableModules") {
|
||||
doLast {
|
||||
rootProject.subprojects.each { project ->
|
||||
if (project.plugins.hasPlugin('maven-publish')) {
|
||||
println(":${project.name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -6,14 +6,17 @@ import java.net.http.HttpResponse
|
||||
apply plugin: 'maven-publish'
|
||||
// This script work based on https://ossrh-staging-api.central.sonatype.com/swagger-ui/#/default/manual_upload_repository
|
||||
// and getting available open repos and just uploading them
|
||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||
def taskName = "uploadSonatypePublication"
|
||||
if (rootProject.tasks.names.contains(taskName) == false) {
|
||||
rootProject.tasks.register(taskName) {
|
||||
doLast {
|
||||
def uploadTaskName = "uploadSonatypePublication"
|
||||
String getBearer() {
|
||||
def username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
|
||||
def password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
|
||||
def bearer = Base64.getEncoder().encodeToString("$username:$password".getBytes(StandardCharsets.UTF_8))
|
||||
return Base64.getEncoder().encodeToString("$username:$password".getBytes(StandardCharsets.UTF_8))
|
||||
}
|
||||
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
|
||||
if (rootProject.tasks.names.contains(uploadTaskName) == false) {
|
||||
rootProject.tasks.register(uploadTaskName) {
|
||||
doLast {
|
||||
def bearer = getBearer()
|
||||
|
||||
def client = HttpClient.newHttpClient()
|
||||
def request = HttpRequest.newBuilder()
|
||||
@@ -39,7 +42,7 @@ if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != n
|
||||
.build()
|
||||
def uploadResponse = client.send(uploadRequest, HttpResponse.BodyHandlers.ofString())
|
||||
if (uploadResponse.statusCode() != 200) {
|
||||
throw new IllegalStateException("Faced error of uploading for repo with key $it. Response: $uploadResponse")
|
||||
println("Faced error of uploading for repo with key $it. Response: $uploadResponse. Check https://central.sonatype.com/publishing/deployments for info or repo with key $it. Response: $uploadResponse")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
25
publish_all_script
Executable file
25
publish_all_script
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
function send_notification() {
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
function assert_success() {
|
||||
"${@}"
|
||||
local status=${?}
|
||||
if [ ${status} -ne 0 ]; then
|
||||
send_notification "### Error ${status} at: ${BASH_LINENO[*]} ###"
|
||||
exit ${status}
|
||||
fi
|
||||
}
|
||||
|
||||
readarray -t projects <<< "`./gradlew getPublishableModules --quiet`"
|
||||
for project in "${projects[@]}"; do
|
||||
echo "Start publishing of $project"
|
||||
assert_success ./gradlew "$project:publishAllPublicationsToSonatypeRepository" --no-parallel --quiet
|
||||
echo "Complete publishing of $project"
|
||||
echo "Start uploading of $project"
|
||||
assert_success ./gradlew uploadSonatypePublication --quiet
|
||||
echo "Complete uploading of $project"
|
||||
done
|
||||
|
@@ -364,7 +364,8 @@ public final class dev/inmo/tgbotapi/extensions/api/business/ReadBusinessMessage
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/business/RemoveBusinessAccountProfilePhotoKt {
|
||||
public static final fun removeBusinessAccountProfilePhoto-spp27rg (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun removeBusinessAccountProfilePhoto-wC12z2M (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun removeBusinessAccountProfilePhoto-wC12z2M$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/business/SetBusinessAccountBioKt {
|
||||
|
Reference in New Issue
Block a user