Skip to content

Commit 557385c

Browse files
committed
let's goo
1 parent a7def05 commit 557385c

File tree

6 files changed

+44
-74
lines changed

6 files changed

+44
-74
lines changed

.github/workflows/maven-central-publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
dry_run:
1414
description: "Dry run - publish to local Maven repo only"
1515
required: false
16-
default: true
16+
default: false
1717
type: boolean
1818

1919
jobs:
@@ -122,22 +122,22 @@ jobs:
122122
sed -i "s/version = .*/version = \"${{ github.event.inputs.version }}\"/" build.gradle.kts
123123
124124
- name: Publish to Maven Central
125-
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false')
125+
if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == false)
126126
run: |
127127
cd bindings/kotlin
128-
./gradlew publish --no-daemon --no-parallel
128+
./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache
129129
env:
130-
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
131-
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
132-
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }}
133-
ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }}
130+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
131+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
132+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }}
133+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }}
134134

135135
- name: Dry run - Local publish only
136-
if: github.event_name != 'release' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run == 'true')
136+
if: github.event_name != 'release' && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run == true)
137137
run: |
138138
cd bindings/kotlin
139139
echo "Dry run: Publishing to local Maven repository only"
140-
./gradlew publishToMavenLocal --no-daemon --no-parallel
140+
./gradlew publishToMavenLocal --no-daemon --no-parallel --no-configuration-cache
141141
env:
142-
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }}
143-
ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }}
142+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }}
143+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }}

bindings/kotlin/build.gradle.kts

Lines changed: 29 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ plugins {
55
kotlin("jvm") version "1.9.24"
66
kotlin("plugin.serialization") version "1.9.24"
77
id("com.ncorti.ktfmt.gradle") version "0.25.0"
8+
id("com.vanniktech.maven.publish") version "0.30.0"
89
application
9-
`maven-publish`
1010
signing
1111
}
1212

1313
group = "org.iota"
1414

15-
version = "1.0-SNAPSHOT"
15+
version = "0.0.1-alpha.1"
1616

1717
repositories { mavenCentral() }
1818

@@ -88,8 +88,6 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
8888
"-Xno-receiver-assertions",
8989
// Add these flags to help with recursive type issues
9090
"-Xtype-enhancement-improvements-strict-mode=false",
91-
"-Xskip-runtime-version-check",
92-
"-Xlenient-function-type-parameter-checks",
9391
)
9492
allWarningsAsErrors = false
9593
suppressWarnings = true
@@ -109,67 +107,43 @@ tasks.register("compileWithErrors") {
109107
}
110108
}
111109

112-
publishing {
113-
publications {
114-
create<MavenPublication>("maven") {
115-
from(components["java"])
116-
pom {
117-
name.set("IOTA SDK Kotlin Bindings")
118-
description.set("Kotlin bindings for the IOTA SDK")
119-
url.set("https://github.com/iotaledger/iota-rust-sdk")
120-
licenses {
121-
license {
122-
name.set("Apache-2.0")
123-
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
124-
}
125-
}
126-
developers {
127-
developer {
128-
id.set("iotaledger")
129-
name.set("IOTA Foundation")
130-
email.set("contact@iota.org")
131-
}
132-
}
133-
scm {
134-
connection.set("scm:git:git://github.com/iotaledger/iota-rust-sdk.git")
135-
developerConnection.set("scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git")
136-
url.set("https://github.com/iotaledger/iota-rust-sdk")
137-
}
110+
mavenPublishing {
111+
publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL)
112+
signAllPublications()
113+
114+
coordinates("org.iota", "iota-sdk", version.toString())
115+
116+
pom {
117+
name.set("IOTA SDK Kotlin Bindings")
118+
description.set("Kotlin bindings for the IOTA SDK")
119+
url.set("https://github.com/iotaledger/iota-rust-sdk")
120+
licenses {
121+
license {
122+
name.set("Apache-2.0")
123+
url.set("https://www.apache.org/licenses/LICENSE-2.0.txt")
138124
}
139125
}
140-
}
141-
repositories {
142-
maven {
143-
name = "ossrh"
144-
url =
145-
uri(
146-
if (version.toString().endsWith("SNAPSHOT")) {
147-
"https://s01.oss.sonatype.org/content/repositories/snapshots/"
148-
} else {
149-
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
150-
}
151-
)
152-
val sonatypeUsername =
153-
providers.environmentVariable("ORG_GRADLE_PROJECT_SONATYPE_USERNAME")
154-
val sonatypePassword =
155-
providers.environmentVariable("ORG_GRADLE_PROJECT_SONATYPE_PASSWORD")
156-
if (sonatypeUsername.isPresent && sonatypePassword.isPresent) {
157-
credentials {
158-
username = sonatypeUsername.get()
159-
password = sonatypePassword.get()
160-
}
126+
developers {
127+
developer {
128+
id.set("iotaledger")
129+
name.set("IOTA Foundation")
130+
email.set("contact@iota.org")
161131
}
162132
}
133+
scm {
134+
connection.set("scm:git:git://github.com/iotaledger/iota-rust-sdk.git")
135+
developerConnection.set("scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git")
136+
url.set("https://github.com/iotaledger/iota-rust-sdk")
137+
}
163138
}
164139
}
165140

166141
signing {
167-
val signingKeyEncoded =
168-
providers.environmentVariable("ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY")
169-
val signingPassword = providers.environmentVariable("ORG_GRADLE_PROJECT_SIGNING_PASSWORD")
142+
val signingKeyEncoded = providers.environmentVariable("ORG_GRADLE_PROJECT_signingInMemoryKey")
143+
val signingPassword =
144+
providers.environmentVariable("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword")
170145
if (signingKeyEncoded.isPresent && signingPassword.isPresent) {
171146
val signingKey = String(Base64.getDecoder().decode(signingKeyEncoded.get()))
172147
useInMemoryPgpKeys(signingKey, signingPassword.get())
173-
sign(publishing.publications["maven"])
174148
}
175149
}

bindings/kotlin/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

bindings/kotlin/gradlew

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -114,7 +114,6 @@ case "$( uname )" in #(
114114
NONSTOP* ) nonstop=true ;;
115115
esac
116116

117-
CLASSPATH="\\\"\\\""
118117

119118

120119
# Determine the Java command to use to start the JVM.
@@ -172,7 +171,6 @@ fi
172171
# For Cygwin or MSYS, switch paths to Windows format before running java
173172
if "$cygwin" || "$msys" ; then
174173
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
175-
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
176174

177175
JAVACMD=$( cygpath --unix "$JAVACMD" )
178176

@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
212210

213211
set -- \
214212
"-Dorg.gradle.appname=$APP_BASE_NAME" \
215-
-classpath "$CLASSPATH" \
216213
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
217214
"$@"
218215

bindings/kotlin/gradlew.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ goto fail
7070
:execute
7171
@rem Setup the command line
7272

73-
set CLASSPATH=
7473

7574

7675
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
76+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7877

7978
:end
8079
@rem End local scope for the variables with windows NT shell

bindings/kotlin/settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rootProject.name = "iota-sdk-jvm"
1+
rootProject.name = "iota-sdk"
22

33
include(":lib")
44

0 commit comments

Comments
 (0)