From ff24b9f35bcee8e2d678ea4643ad99b80c0dd625 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 2 Mar 2021 15:54:13 +0600 Subject: [PATCH] add workflow for packages publication --- .github/workflows/packages_publishing.yml | 24 +++++++++++++++++++ tgbotapi.core/mpp_publish_template.kpsb | 2 +- tgbotapi.core/publish.gradle | 12 ++++------ .../mpp_publish_template.kpsb | 2 +- tgbotapi.extensions.api/publish.gradle | 12 ++++------ .../mpp_publish_template.kpsb | 2 +- .../publish.gradle | 12 ++++------ .../mpp_publish_template.kpsb | 2 +- tgbotapi.extensions.utils/publish.gradle | 12 ++++------ 9 files changed, 44 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/packages_publishing.yml diff --git a/.github/workflows/packages_publishing.yml b/.github/workflows/packages_publishing.yml new file mode 100644 index 0000000000..544406eff7 --- /dev/null +++ b/.github/workflows/packages_publishing.yml @@ -0,0 +1,24 @@ + +name: Publish package to GitHub Packages +on: [push] +jobs: + publishing: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Rewrite version + run: | + branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`" + cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp + rm gradle.properties + mv gradle.properties.tmp gradle.properties + - name: Build and publish + run: ./gradlew clean build publishAllPublicationsToGithubPackagesRepository -x signJsPublication -x signJvmPublication -x signKotlinMultiplatformPublication -x signMetadataPublication + env: + GITHUBPACKAGES_USER: ${{ github.actor }} + GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + SONATYPE_USER: "plug" + SONATYPE_PASSWORD: "plug" diff --git a/tgbotapi.core/mpp_publish_template.kpsb b/tgbotapi.core/mpp_publish_template.kpsb index 3ab5711efd..30b9e6fab3 100644 --- a/tgbotapi.core/mpp_publish_template.kpsb +++ b/tgbotapi.core/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Core","description":"Library for Object-Oriented and type-safe work with Telegram Bot API","url":"https://insanusmokrassar.github.io/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file diff --git a/tgbotapi.core/publish.gradle b/tgbotapi.core/publish.gradle index 4da193013f..d22ef4a7d7 100644 --- a/tgbotapi.core/publish.gradle +++ b/tgbotapi.core/publish.gradle @@ -38,17 +38,15 @@ publishing { } } - repositories { maven { - name = "bintray" - url = uri("https://api.bintray.com/maven/${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}/TelegramBotAPI/${project.name}/;publish=1;override=1") + name = "GithubPackages" + url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI") credentials { - username = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') - password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') + username = project.hasProperty('GITHUBPACKAGE_USER') ? project.property('GITHUBPACKAGE_USER') : System.getenv('GITHUBPACKAGE_USER') + password = project.hasProperty('GITHUBPACKAGE_PASSWORD') ? project.property('GITHUBPACKAGE_PASSWORD') : System.getenv('GITHUBPACKAGE_PASSWORD') } } - maven { name = "sonatype" url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") @@ -57,9 +55,7 @@ publishing { password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') } } - } - } } diff --git a/tgbotapi.extensions.api/mpp_publish_template.kpsb b/tgbotapi.extensions.api/mpp_publish_template.kpsb index 11162eaf0c..a0b4d37d9d 100644 --- a/tgbotapi.extensions.api/mpp_publish_template.kpsb +++ b/tgbotapi.extensions.api/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Extensions for API","description":"API extensions which provide work with RequestsExecutor of TelegramBotAPI almost like it is described in original Telegram Bot API reference","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-api","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file diff --git a/tgbotapi.extensions.api/publish.gradle b/tgbotapi.extensions.api/publish.gradle index 373e5538f1..f9b84ef8f3 100644 --- a/tgbotapi.extensions.api/publish.gradle +++ b/tgbotapi.extensions.api/publish.gradle @@ -38,17 +38,15 @@ publishing { } } - repositories { maven { - name = "bintray" - url = uri("https://api.bintray.com/maven/${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}/TelegramBotAPI/${project.name}/;publish=1;override=1") + name = "GithubPackages" + url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI") credentials { - username = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') - password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') + username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER') + password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD') } } - maven { name = "sonatype" url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") @@ -57,9 +55,7 @@ publishing { password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') } } - } - } } diff --git a/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb b/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb index b1cec57fa3..21548e829f 100644 --- a/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb +++ b/tgbotapi.extensions.behaviour_builder/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Steps Extensions","description":"This extensions project contains tools for simple interaction with chats","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.steps","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Steps Extensions","description":"This extensions project contains tools for simple interaction with chats","url":"https://insanusmokrassar.github.io/TelegramBotAPI/tgbotapi.extensions.steps","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file diff --git a/tgbotapi.extensions.behaviour_builder/publish.gradle b/tgbotapi.extensions.behaviour_builder/publish.gradle index 0ffbe9a1e4..3950b86841 100644 --- a/tgbotapi.extensions.behaviour_builder/publish.gradle +++ b/tgbotapi.extensions.behaviour_builder/publish.gradle @@ -38,17 +38,15 @@ publishing { } } - repositories { maven { - name = "bintray" - url = uri("https://api.bintray.com/maven/${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}/TelegramBotAPI/${project.name}/;publish=1;override=1") + name = "GithubPackages" + url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI") credentials { - username = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') - password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') + username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER') + password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD') } } - maven { name = "sonatype" url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") @@ -57,9 +55,7 @@ publishing { password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') } } - } - } } diff --git a/tgbotapi.extensions.utils/mpp_publish_template.kpsb b/tgbotapi.extensions.utils/mpp_publish_template.kpsb index 4bca81cb8c..b9cb0896cd 100644 --- a/tgbotapi.extensions.utils/mpp_publish_template.kpsb +++ b/tgbotapi.extensions.utils/mpp_publish_template.kpsb @@ -1 +1 @@ -{"bintrayConfig":{"repo":"TelegramBotAPI","packageName":"${project.name}","packageVcs":"https://github.com/InsanusMokrassar/TelegramBotAPI","autoPublish":true,"overridePublish":true},"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"publishToMavenCentral":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}]}} \ No newline at end of file +{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"Telegram Bot API Utility Extensions","description":"Util extensions for more useful work with updates and other things","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI-extensions-utils","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","includeGpgSigning":true,"developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}]}} \ No newline at end of file diff --git a/tgbotapi.extensions.utils/publish.gradle b/tgbotapi.extensions.utils/publish.gradle index d164628dc6..e5cafcb846 100644 --- a/tgbotapi.extensions.utils/publish.gradle +++ b/tgbotapi.extensions.utils/publish.gradle @@ -38,17 +38,15 @@ publishing { } } - repositories { maven { - name = "bintray" - url = uri("https://api.bintray.com/maven/${project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER')}/TelegramBotAPI/${project.name}/;publish=1;override=1") + name = "GithubPackages" + url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI") credentials { - username = project.hasProperty('BINTRAY_USER') ? project.property('BINTRAY_USER') : System.getenv('BINTRAY_USER') - password = project.hasProperty('BINTRAY_KEY') ? project.property('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') + username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER') + password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD') } } - maven { name = "sonatype" url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/") @@ -57,9 +55,7 @@ publishing { password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD') } } - } - } }