From 1860a073ce698886f5a8c6078aa35314e5004de9 Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 08:59:38 +0100 Subject: [PATCH 1/7] Add Github workflow for publishing maven pkg --- .github/workflows/publish.yml | 24 ++++++++++++++++++++++++ build.gradle.kts | 16 ++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..194f487 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,24 @@ +name: Publish package to GitHub Packages +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'adopt' + - name: Validate Gradle wrapper + uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b + - name: Publish package + uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 + with: + arguments: publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 0293479..4e8a82e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,14 +4,13 @@ plugins { kotlin("jvm") version "1.7.20" kotlin("plugin.serialization") version "1.7.20" + `maven-publish` application } group = "com.radixdlt" version = "1.0-SNAPSHOT" - - repositories { mavenCentral() } @@ -36,3 +35,16 @@ tasks.withType { application { mainClass.set("MainKt") } + +publishing { + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/radixdlt/maven-pkg" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} From 5cede79d39e9f233d3f388ccaeea7a7853763d5e Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 09:04:48 +0100 Subject: [PATCH 2/7] Fix uri type --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4e8a82e..ee4026e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,7 +40,7 @@ publishing { repositories { maven { name = "GitHubPackages" - url = "https://maven.pkg.github.com/radixdlt/maven-pkg" + url = uri("https://maven.pkg.github.com/radixdlt/maven-pkg") credentials { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN") From 1ad6b4e93294338061d3510d70a9c25deb4b64ab Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 09:11:36 +0100 Subject: [PATCH 3/7] Add publication --- build.gradle.kts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index ee4026e..bc3b647 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -37,6 +37,21 @@ application { } publishing { + publications { + create("mavenJava") { + groupId = project.group.toString() + artifactId = rootProject.name + version = project.version.toString() + + from(components["java"]) + + pom { + name.set("slip10-android") + description.set("Implementation of SLIP-10") + url.set("https://github.com/radixdlt/SLIP10-Android") + } + } + } repositories { maven { name = "GitHubPackages" From 36b5c1a01607644ce13807d4fb22cb1e56f8aba9 Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 09:15:45 +0100 Subject: [PATCH 4/7] Add publication --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index bc3b647..ad398bd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -40,7 +40,7 @@ publishing { publications { create("mavenJava") { groupId = project.group.toString() - artifactId = rootProject.name + artifactId = "slip10-android" version = project.version.toString() from(components["java"]) From 5ee4da772ae417e4178b927fd1c92e7c8f2f94cc Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 09:18:46 +0100 Subject: [PATCH 5/7] Add publication --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index ad398bd..13f5b92 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "com.radixdlt" -version = "1.0-SNAPSHOT" +version = "1.0-snapshot" repositories { mavenCentral() From 67bdb5f90954e308b88d676f0f4c58cf9079abd1 Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 09:37:11 +0100 Subject: [PATCH 6/7] Add publication --- build.gradle.kts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 13f5b92..0b0f829 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -42,14 +42,7 @@ publishing { groupId = project.group.toString() artifactId = "slip10-android" version = project.version.toString() - from(components["java"]) - - pom { - name.set("slip10-android") - description.set("Implementation of SLIP-10") - url.set("https://github.com/radixdlt/SLIP10-Android") - } } } repositories { From 841068ba47aa6615c8b0bdcc0db03f6a7de29e58 Mon Sep 17 00:00:00 2001 From: Marek Karwacki Date: Wed, 11 Jan 2023 09:51:39 +0100 Subject: [PATCH 7/7] Add publication --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0b0f829..8754291 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -48,7 +48,7 @@ publishing { repositories { maven { name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/radixdlt/maven-pkg") + url = uri("https://maven.pkg.github.com/radixdlt/slip10-android") credentials { username = System.getenv("GITHUB_ACTOR") password = System.getenv("GITHUB_TOKEN")