From 6be34506230094bc09208039d1ddc0f5ec18f8b0 Mon Sep 17 00:00:00 2001 From: Walter Huf Date: Wed, 1 May 2024 19:55:14 -0700 Subject: [PATCH] Try publishing the multiplatform package to Github --- .github/workflows/build.yml | 25 ++++++++++++++++++++++++- core/build.gradle | 19 ++++++++++++------- etch/build.gradle | 20 ++++++++++++++++---- settings.gradle | 4 ++-- 4 files changed, 54 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e03bc0..bd0cb83 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,4 +28,27 @@ jobs: - name: Upload coverage results run: ./gradlew coverage coveralls --stacktrace env: - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} \ No newline at end of file + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + publish: + runs-on: ubuntu-latest + steps: + - name: Checkout the project + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - name: Set release name + run: sed -i "s/^\s+version '.*'/version '${{ github.event.inputs.version }}'/" build.gradle && cat build.gradle + if: ${{ github.event.inputs.version }} + - name: Build the project + run: ./gradlew build --stacktrace + - name: Publish package to Github + run: ./gradlew publish + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/core/build.gradle b/core/build.gradle index d83be44..19dd31e 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -23,7 +23,7 @@ kotlin { } jvmMain { dependencies { - implementation project(path: ':IDriveConnectKitEtch') + api project(path: ':idriveconnectkit-etch') } } @@ -36,13 +36,18 @@ kotlin { sourceCompatibility = "1.8" targetCompatibility = "1.8" +group = 'io.bimmergestalt' +version = '0.6-etch-split' + publishing { - publications { - maven(MavenPublication) { - // publish to Jitpack - groupId 'io.bimmergestalt' - artifactId 'IDriveConnectKit' - version '0.6' + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/BimmerGestalt/IDriveConnectKit" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } } } } diff --git a/etch/build.gradle b/etch/build.gradle index 78e78be..809506f 100644 --- a/etch/build.gradle +++ b/etch/build.gradle @@ -79,16 +79,28 @@ compileJava.dependsOn extractEtchRuntime compileJava.mustRunAfter compileEtch compileJava.mustRunAfter enableEtchRuntime +group = 'io.bimmergestalt' +version = '0.6-etch-split' publishing { publications { maven(MavenPublication) { - // publish to Jitpack + // package names for Maven/Jitpack groupId 'io.bimmergestalt' - artifactId 'IDriveConnectKitEtch' - version '0.6' + artifactId 'idriveconnectkit-etch' + version '0.6-etch-split' from components.java } } -} + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/BimmerGestalt/IDriveConnectKit" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 2235034..7c33ae8 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,3 @@ include ':core', ':etch' -project(':core').name = "IDriveConnectKit" -project(':etch').name = "IDriveConnectKitEtch" \ No newline at end of file +project(':core').name = "idriveconnectkit" +project(':etch').name = "idriveconnectkit-etch" \ No newline at end of file