Skip to content

Commit

Permalink
Attempt to publish ORX on Maven Central
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Nov 28, 2021
1 parent c06540c commit abac03d
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/generate-screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 16
java-version: 17
- uses: openrndr/setup-opengl@v1.1
- name: Test glxinfo
run: |
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/release-candidate-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release candidate to Maven Central
on:
push:
tags:
- v[0-9].[0-9]+.[0-9]+-rc.[0-9]+
jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: Get OPENRNDR release tag
run: echo "OPENRNDR_VERSION=$(git ls-remote --refs --tags https://github.com/openrndr/openrndr | cut --delimiter='/' --fields=3 | sort --version-sort | tail --lines=1)" >> $GITHUB_ENV
- 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: 17
- name: Build ORX
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 -Popenrndr.version=${{env.OPENRNDR_VERSION}} -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}}
12 changes: 7 additions & 5 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release to Bintray
name: Release to Maven Central
on:
push:
tags:
Expand All @@ -7,21 +7,23 @@ jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Get OPENRNDR release tag
run: echo "OPENRNDR_VERSION=$(git ls-remote --refs --tags https://github.com/openrndr/openrndr | cut --delimiter='/' --fields=3 | sort --version-sort | tail --lines=1)" >> $GITHUB_ENV
- 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
java-version: 17
- name: Build ORX
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)
run: ./gradlew publish -Popenrndr.version=${{env.OPENRNDR_VERSION}} -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}}
138 changes: 128 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform

buildscript {
repositories {
mavenCentral()
Expand Down Expand Up @@ -34,6 +32,8 @@ def multiplatformModules = [
"orx-quadtree",
]

def doNotPublish = ["openrndr-demos"]

project.ext {
kotlinApiVersion = '1.6'
kotlinLanguageVersion = '1.6'
Expand All @@ -47,14 +47,17 @@ project.ext {
junitJupiterVersion = '5.7.1'
}

def openrndrUseSnapshot = true



apply plugin: 'org.jetbrains.dokka'

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

def openrndrUseSnapshot = isReleaseVersion

project.ext {
openrndrVersion = openrndrUseSnapshot? "0.5.1-SNAPSHOT" : "0.4.0"
openrndrVersion = findProperty("openrndr.version")?.replace("v","") ?: "0.5.1-SNAPSHOT"
jvmTarget = "1.8"
kotlinVersion = "1.6.0"
kotlinApiVersion = "1.4"
Expand Down Expand Up @@ -181,20 +184,134 @@ task buildMainReadme {
}
}

configure(allprojects.findAll { !doNotPublish.contains(it.name) && (multiplatformModules.contains(it.name)) }) {
apply plugin: 'maven-publish'
apply plugin: 'signing'

configure(allprojects.findAll { !multiplatformModules.contains(it.name) }) {
def fjdj = tasks.create("fakeJavaDocJar", Jar) {
archiveClassifier = "javadoc"
}


publishing {
publications {
all {
pom {
name = "$project.name"
description = "$project.name"
url = 'https://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
}

}

configure(allprojects.findAll { !doNotPublish.contains(it.name) && !multiplatformModules.contains(it.name) }) {
// apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'nebula.release'
apply plugin: 'signing'


def proj = it
println proj
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
groupId = "org.openrndr.extra"
artifactId = "$project.name"
description = "$project.name"
pom {
name = "$project.name"
description = "$project.name"
url = 'https://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/orx/blob/master/LICENSE'
distribution = 'repo'
}
}
}
scm {
connection = "scm:git:git@github.com:openrndr/orx.git"
developerConnection = "scm:git:ssh://github.com/openrndr/orx.git"
url = "https://github.com/openrndr/orx"
}
}
}
}
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
}

dependencies {
Expand All @@ -214,6 +331,7 @@ configure(allprojects.findAll { !multiplatformModules.contains(it.name) }) {
testRuntimeOnly "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
}


test {
useJUnitPlatform {
includeEngines 'spek2'
Expand All @@ -234,10 +352,10 @@ configure(allprojects.findAll { !multiplatformModules.contains(it.name) }) {
}
}

configure(allprojects.findAll { it.name != "openrndr-demos" }) {
apply plugin: 'maven-publish'
apply plugin: 'nebula.release'
}
//configure(allprojects.findAll { it.name != "openrndr-demos" }) {
// apply plugin: 'maven-publish'
// apply plugin: 'nebula.release'
//}


//collectScreenshots.dependsOn {
Expand Down
2 changes: 2 additions & 0 deletions openrndr-demos/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
apply plugin: 'java'
apply plugin: 'kotlin'
sourceSets {
demo {
java {
Expand Down

0 comments on commit abac03d

Please sign in to comment.