From f2b280ae400453c0b1f7f12396eab5288284e382 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Tue, 13 Apr 2021 13:03:00 +0200 Subject: [PATCH] Replace nebula-publishing for maven-publish, remove bintray release action --- .github/workflows/release-to-bintray.yml | 29 ------ .../workflows/release-to-maven-central.yml | 27 ++++++ build.gradle | 94 +++++++++++++++---- 3 files changed, 105 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/release-to-bintray.yml create mode 100644 .github/workflows/release-to-maven-central.yml diff --git a/.github/workflows/release-to-bintray.yml b/.github/workflows/release-to-bintray.yml deleted file mode 100644 index 13416e37..00000000 --- a/.github/workflows/release-to-bintray.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Release to Bintray -on: - push: - tags: - - v[0-9].[0-9]+.[0-9]+ -jobs: - build: - runs-on: ubuntu-18.04 - steps: - - uses: actions/checkout@v2 - - name: Get the version - id: get_version - run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} - - uses: actions/setup-java@v1 - with: - java-version: 8 - - name: Build and publish to local maven - run: ./gradlew -Prelease.useLastTag=true release publishToMavenLocal --info - - name: Zip and publish to Bintray - run: | - cd ~/.m2/repository - zip release.zip org/openrndr/extra/*/${{ steps.get_version.outputs.VERSION }}/* - curl -u ${{ secrets.BINTRAY_USER }}:${{ secrets.BINTRAY_KEY }} -X PUT https://api.bintray.com/content/openrndr/openrndr/ \ - -H "X-Bintray-Package:orx" \ - -H "X-Bintray-Version:${{ steps.get_version.outputs.VERSION }}" \ - -H "X-Bintray-Publish:1" \ - -H "X-Bintray-Override:1" \ - -H "X-Bintray-Explode:1" \ - -T release.zip \ No newline at end of file diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml new file mode 100644 index 00000000..f1941b90 --- /dev/null +++ b/.github/workflows/release-to-maven-central.yml @@ -0,0 +1,27 @@ +name: Release to Bintray +on: + push: + tags: + - v[0-9].[0-9]+.[0-9]+ +jobs: + build: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/} + - uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Build and publish to local maven + run: ./gradlew -Prelease.useLastTag=true build + - name: Decode + run: | + echo "${{secrets.SIGNING_SECRET_KEY_RING_FILE}}" > ~/.gradle/secring.gpg.b64 + base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg + - name: Publish + run: ./gradlew publish -Prelease.useLastTag=true -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_KEY_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) + env: + OSSRH_USERNAME: ${{secrets.OSSRH_USERNAME}} + OSSRH_PASSWORD: ${{secrets.OSSRH_PASSWORD}} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 91b2b09c..cdd1b805 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,11 @@ +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform + buildscript { repositories { jcenter() } dependencies { classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17" - classpath "com.netflix.nebula:nebula-publishing-plugin:17.3.0" classpath "com.netflix.nebula:nebula-release-plugin:15.1.0" classpath "com.github.ben-manes:gradle-versions-plugin:0.28.0" } @@ -17,6 +18,8 @@ def openrndrUseSnapshot = false apply plugin: 'org.jetbrains.dokka' +ext.isReleaseVersion = !version.endsWith("SNAPSHOT") + project.ext { openrndrVersion = openrndrUseSnapshot? "0.4.0-SNAPSHOT" : "0.3.47" kotlinVersion = "1.4.32" @@ -53,13 +56,8 @@ allprojects { apply plugin: 'idea' apply plugin: 'java' apply plugin: 'kotlin' - apply plugin: 'nebula.contacts' - apply plugin: 'nebula.info' apply plugin: 'nebula.release' - apply plugin: 'nebula.maven-publish' - apply plugin: 'nebula.source-jar' - apply plugin: 'nebula.javadoc-jar' apply plugin: "com.github.ben-manes.versions" group 'org.openrndr.extra' @@ -71,9 +69,6 @@ allprojects { mavenCentral() jcenter() - maven { - url = "https://dl.bintray.com/openrndr/openrndr" - } maven { url "https://dl.bintray.com/spekframework/spek" } @@ -102,13 +97,6 @@ allprojects { options.addBooleanOption 'Xdoclint:none', true } - contacts { - 'edwin@openrndr.org' { - moniker 'Edwin Jakobs' - github 'edwinRNDR' - } - } - test { useJUnitPlatform { includeEngines 'spek2' @@ -261,6 +249,80 @@ task collectScreenshots { } } } + +configure(allprojects.findAll { it.name != "openrndr-demos" }) { + apply plugin: 'nebula.release' + apply plugin: 'maven-publish' + apply plugin: 'signing' + + java { + withJavadocJar() + withSourcesJar() + } + + publishing { + publications { + mavenJava(MavenPublication) { + from components.java + groupId = "org.openrndr.extra" + artifactId = "$project.name" + + description = "$project.name" + pom { + name = "$project.name" + description = "$project.name" + url = 'http://openrndr.org' + developers { + developer { + id = 'edwinjakobs' + name = 'Edwin Jakobs' + email = 'edwin@openrndr.org' + } + } + license { + licenses { + license { + name = 'BSD-2-Clause' + url = 'https://github.com/openrndr/openrndr/blob/master/LICENSE' + distribution = 'repo' + } + } + } + scm { + connection = "scm:git:git@github.com:openrndr/openrndr.git" + developerConnection = "scm:git:ssh://github.com/openrndr/openrndr.git" + url = "https://github.com/openrndr/openrndr" + } + } + } + } + repositories { + maven { + credentials { + username findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME") + password findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD") + } + if (!isReleaseVersion) { + url "https://s01.oss.sonatype.org/content/repositories/snapshots" + } else { + url "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2" + } + } + } + } + signing { + required { isReleaseVersion && gradle.taskGraph.hasTask("publish") } + sign publishing.publications.mavenJava + } +} + +configure(subprojects) { + tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { + kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi"] + } +} + + collectScreenshots.dependsOn { project.subprojects.findAll { it.sourceSets.hasProperty("demo") }.collect { it.tasks.demoClasses } }