From beb1db2ed056faf951981a431b30da6e65579f0c Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 13:32:34 +0200 Subject: [PATCH 1/9] Fix --- .../build.gradle.kts | 9 +++++++-- .../gradle.properties | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts index 6789a439..43a705dc 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts +++ b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts @@ -40,7 +40,7 @@ tasks.withType { kotlinOptions { jvmTarget = JavaVersion.VERSION_ gradlePlugin { plugins { - create(property("id").toString()) { + register("sentryPlugin") { id = property("id").toString() implementationClass = property("implementationClass").toString() } @@ -73,7 +73,12 @@ distributions { main { contents { from("build${sep}libs") - from("build${sep}publications${sep}maven") + from("build${sep}publications${sep}pluginMaven") + } + } + create("sentryPluginMarker") { + contents { + from("build${sep}publications${sep}sentryPluginPluginMarkerMaven") } } } diff --git a/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties b/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties index 73eb14b5..800c6051 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties +++ b/sentry-kotlin-multiplatform-gradle-plugin/gradle.properties @@ -4,3 +4,18 @@ versionName=0.7.1 group=io.sentry # TODO: Update update-cocoa.sh so the cocoa version is auto updated as well sentryCocoaVersion=8.26.0 + +# publication pom properties +POM_NAME=Sentry Kotlin Multiplatform Gradle Plugin +POM_DESCRIPTION=Sentry Kotlin Multiplatform Gradle Plugin +POM_URL=https://github.com/getsentry/sentry-kotlin-multiplatform +POM_SCM_URL=https://github.com/getsentry/sentry-kotlin-multiplatform +POM_SCM_CONNECTION=scm:git:git://github.com/getsentry/sentry-kotlin-multiplatform.git +POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/getsentry/sentry-kotlin-multiplatform.git + +POM_LICENCE_NAME=MIT +POM_LICENCE_URL=https://github.com/getsentry/sentry-kotlin-multiplatform/blob/main/LICENSE + +POM_DEVELOPER_ID=getsentry +POM_DEVELOPER_NAME=Sentry Team and Contributors +POM_DEVELOPER_URL=https://github.com/getsentry/ \ No newline at end of file From f2de2091ee09fbb71a9c9e9df391031ac95feca3 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 16:52:56 +0200 Subject: [PATCH 2/9] Update --- .github/workflows/upload-artifacts.yml | 44 +++++++++++++++++++ .../build.gradle.kts | 16 +++---- 2 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/upload-artifacts.yml diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml new file mode 100644 index 00000000..6763d05c --- /dev/null +++ b/.github/workflows/upload-artifacts.yml @@ -0,0 +1,44 @@ +name: "Plugin: sentry-kotlin-multiplatform" +on: + push: + branches: + - main + - release/** + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + archive-distribution: + runs-on: macos-latest-xlarge + + steps: + - uses: actions/checkout@v4 + + - name: JDK setup + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: temurin + + - name: Cached Gradle + uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a + + - name: DistZip libraries + run: | + ./gradlew distZip + + - name: DistZip plugin + run: | + cd sentry-kotlin-multiplatform-gradle-plugin + ./gradlew distZip sentryPluginMarkerDistZip + + - name: Archive packages + uses: actions/upload-artifact@v3 + with: + name: ${{ github.sha }} + if-no-files-found: error + path: | + ./*/build/distributions/*.zip diff --git a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts index 43a705dc..429a5251 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts +++ b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts @@ -52,22 +52,16 @@ val publish = extensions.getByType(MavenPublishPluginExtension::class.java) // via gpg:sign-and-deploy-file (release.kts) publish.releaseSigningEnabled = false -tasks.named("distZip").configure { +tasks.named("distZip") { dependsOn("publishToMavenLocal") - this.doLast { - val distributionFilePath = - "${project.layout.buildDirectory.asFile.get().path}${sep}distributions${sep}${project.name}-${project.version}.zip" - val file = File(distributionFilePath) - if (!file.exists()) { - throw IllegalStateException("Distribution file: $distributionFilePath does not exist") - } - if (file.length() == 0L) { - throw IllegalStateException("Distribution file: $distributionFilePath is empty") + onlyIf { + inputs.sourceFiles.isEmpty.not().also { + require(it) { "No distribution to zip." } } } } -val sep = File.separator +val sep: String = File.separator distributions { main { From deeaa5d57563491ffa52958fa1f59295274334f5 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 16:53:38 +0200 Subject: [PATCH 3/9] Update upload artifact to v4 --- .github/workflows/upload-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 6763d05c..0b7047fd 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -36,7 +36,7 @@ jobs: ./gradlew distZip sentryPluginMarkerDistZip - name: Archive packages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ github.sha }} if-no-files-found: error From aff2ee922c20bcd5f8f1cd68f6c67580e00725ec Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 16:55:17 +0200 Subject: [PATCH 4/9] Update workflow name --- .github/workflows/upload-artifacts.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 0b7047fd..a1e7e38e 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -1,9 +1,6 @@ -name: "Plugin: sentry-kotlin-multiplatform" +name: "Generate and upload distributions" on: push: - branches: - - main - - release/** pull_request: concurrency: From 91f73b8a6d629c26653f5c6fb66d5c727caa9339 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 17:12:50 +0200 Subject: [PATCH 5/9] update --- .github/workflows/upload-artifacts.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index a1e7e38e..1a6a1a44 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -30,7 +30,7 @@ jobs: - name: DistZip plugin run: | cd sentry-kotlin-multiplatform-gradle-plugin - ./gradlew distZip sentryPluginMarkerDistZip + ./gradlew distZip && ./gradlew sentryPluginMarkerDistZip - name: Archive packages uses: actions/upload-artifact@v4 From eccf1e8a16160e70e802843c45c6d16c0806926f Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 17:40:18 +0200 Subject: [PATCH 6/9] Update --- .github/workflows/upload-artifacts.yml | 2 +- .../build.gradle.kts | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index 1a6a1a44..a1e7e38e 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -30,7 +30,7 @@ jobs: - name: DistZip plugin run: | cd sentry-kotlin-multiplatform-gradle-plugin - ./gradlew distZip && ./gradlew sentryPluginMarkerDistZip + ./gradlew distZip sentryPluginMarkerDistZip - name: Archive packages uses: actions/upload-artifact@v4 diff --git a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts index 429a5251..e661a3e4 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts +++ b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts @@ -77,6 +77,14 @@ distributions { } } +tasks.named("sentryPluginMarkerDistTar") { + mustRunAfter("generatePomFileForSentryPluginPluginMarkerMavenPublication") +} + +tasks.named("sentryPluginMarkerDistZip") { + mustRunAfter(":generatePomFileForSentryPluginPluginMarkerMavenPublication") +} + buildConfig { useKotlinOutput() packageName("io.sentry") From f9e7bb15e2b1a3ef19bda1c4281e14ab9a1134e7 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 17:55:50 +0200 Subject: [PATCH 7/9] Remove previous archive distribution jobs --- .../kotlin-multiplatform-gradle-plugin.yml | 29 +------------------ .github/workflows/kotlin-multiplatform.yml | 27 ----------------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/.github/workflows/kotlin-multiplatform-gradle-plugin.yml b/.github/workflows/kotlin-multiplatform-gradle-plugin.yml index 719a3a58..646ecdd2 100644 --- a/.github/workflows/kotlin-multiplatform-gradle-plugin.yml +++ b/.github/workflows/kotlin-multiplatform-gradle-plugin.yml @@ -45,31 +45,4 @@ jobs: uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # pin@v4 with: name: sentry-kotlin-multiplatform-gradle-plugin - token: ${{ secrets.CODECOV_TOKEN }} - - archive-distribution: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: JDK setup - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: temurin - - - name: Cached Gradle - uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a - - - name: DistZip - run: | - cd sentry-kotlin-multiplatform-gradle-plugin && ./gradlew distZip - - - name: Archive packages - uses: actions/upload-artifact@v3 - with: - name: ${{ github.sha }} - if-no-files-found: error - path: | - ./*/build/distributions/*.zip + token: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/kotlin-multiplatform.yml b/.github/workflows/kotlin-multiplatform.yml index 6ed25778..2754d011 100644 --- a/.github/workflows/kotlin-multiplatform.yml +++ b/.github/workflows/kotlin-multiplatform.yml @@ -113,30 +113,3 @@ jobs: - name: Test samples run: | ./gradlew allTests -p sentry-samples - - archive-distribution: - runs-on: macos-latest-xlarge - - steps: - - uses: actions/checkout@v4 - - - name: JDK setup - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: temurin - - - name: Cached Gradle - uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a - - - name: DistZip - run: | - ./scripts/build-distribution.sh sentry-kotlin-multiplatform - - - name: Archive packages - uses: actions/upload-artifact@v4 - with: - name: ${{ github.sha }} - if-no-files-found: error - path: | - ./*/build/distributions/*.zip From 5b3a18f32967dfb7bac9ef7c067ee4cf91964193 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 17:56:31 +0200 Subject: [PATCH 8/9] only do it for release branches --- .github/workflows/upload-artifacts.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upload-artifacts.yml b/.github/workflows/upload-artifacts.yml index a1e7e38e..8cf701d1 100644 --- a/.github/workflows/upload-artifacts.yml +++ b/.github/workflows/upload-artifacts.yml @@ -1,7 +1,8 @@ name: "Generate and upload distributions" on: push: - pull_request: + branches: + - release/** concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 8133e3eb0a15ad188cdd808aea7a9bfd4c2a2163 Mon Sep 17 00:00:00 2001 From: GIancarlo Buenaflor Date: Thu, 8 Aug 2024 18:02:28 +0200 Subject: [PATCH 9/9] formatting --- sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts index e661a3e4..f457018c 100644 --- a/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts +++ b/sentry-kotlin-multiplatform-gradle-plugin/build.gradle.kts @@ -82,7 +82,7 @@ tasks.named("sentryPluginMarkerDistTar") { } tasks.named("sentryPluginMarkerDistZip") { - mustRunAfter(":generatePomFileForSentryPluginPluginMarkerMavenPublication") + mustRunAfter("generatePomFileForSentryPluginPluginMarkerMavenPublication") } buildConfig {