From a7def057d796c525c18be89ca96d7c55d0b56ec6 Mon Sep 17 00:00:00 2001 From: Thoralf-M Date: Fri, 7 Nov 2025 10:57:07 +0200 Subject: [PATCH 1/4] feat(kotlin): add publish workflow --- .github/workflows/maven-central-publish.yml | 143 ++++++++++++++++++++ Makefile | 22 +-- bindings/kotlin/README.md | 43 ++++++ bindings/kotlin/build.gradle.kts | 68 ++++++++++ 4 files changed, 268 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/maven-central-publish.yml diff --git a/.github/workflows/maven-central-publish.yml b/.github/workflows/maven-central-publish.yml new file mode 100644 index 000000000..88620023b --- /dev/null +++ b/.github/workflows/maven-central-publish.yml @@ -0,0 +1,143 @@ +name: Publish to Maven Central + +on: + # TODO: remove after testing + push: + branches: [ci/kotlin-release] + workflow_dispatch: + inputs: + version: + description: "Version to publish (leave empty for release version)" + required: false + type: string + dry_run: + description: "Dry run - publish to local Maven repo only" + required: false + default: true + type: boolean + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + lib_ext: so + - os: ubuntu-latest + target: aarch64-unknown-linux-gnu + lib_ext: so + - os: macos-latest + target: x86_64-apple-darwin + lib_ext: dylib + - os: macos-latest + target: aarch64-apple-darwin + lib_ext: dylib + - os: windows-latest + target: x86_64-pc-windows-msvc + lib_ext: dll + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: "21" + distribution: "temurin" + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Build the bindings + run: make kotlin + + - name: Upload native library + uses: actions/upload-artifact@v4 + with: + name: native-lib-${{ matrix.os }}-${{ matrix.target }} + path: bindings/kotlin/lib/*iota_sdk_ffi* + + publish: + runs-on: ubuntu-latest + needs: build + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: "21" + distribution: "temurin" + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + # - name: Build Rust library + # run: cargo build -p iota-sdk-ffi --lib --release + + - name: Download native libraries + uses: actions/download-artifact@v4 + with: + path: libs + + - name: Prepare libraries + run: | + echo "Listing contents of libs directory:" + ls -la libs/ + echo "Listing contents of native-lib-ubuntu-latest-x86_64-unknown-linux-gnu:" + ls -la libs/native-lib-ubuntu-latest-x86_64-unknown-linux-gnu/ + echo "Listing contents of bindings/kotlin/lib before copying:" + ls -la bindings/kotlin/lib/ + cd bindings/kotlin/lib + echo "Copying libraries..." + cp ../../../libs/native-lib-ubuntu-latest-x86_64-unknown-linux-gnu/libiota_sdk_ffi.so . + cp ../../../libs/native-lib-ubuntu-latest-aarch64-unknown-linux-gnu/libiota_sdk_ffi.so libiota_sdk_ffi_arm64.so + cp ../../../libs/native-lib-macos-latest-x86_64-apple-darwin/libiota_sdk_ffi.dylib . + cp ../../../libs/native-lib-macos-latest-aarch64-apple-darwin/libiota_sdk_ffi.dylib libiota_sdk_ffi_arm64.dylib + cp ../../../libs/native-lib-windows-latest-x86_64-pc-windows-msvc/iota_sdk_ffi.dll . + echo "Contents after copying:" + ls -la + + - name: Generate Kotlin bindings + run: | + cd bindings/kotlin + # Generate bindings using the Linux library (arbitrary choice) + cargo run --bin iota_sdk_bindings -- generate --library "lib/libiota_sdk_ffi.so" --language kotlin --out-dir lib --no-format -c uniffi.toml + + - name: Set version for release + if: github.event_name == 'release' + run: | + cd bindings/kotlin + sed -i "s/version = .*/version = \"${{ github.event.release.tag_name }}\"/" build.gradle.kts + + - name: Set version for manual dispatch + if: github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' + run: | + cd bindings/kotlin + sed -i "s/version = .*/version = \"${{ github.event.inputs.version }}\"/" build.gradle.kts + + - name: Publish to Maven Central + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false') + run: | + cd bindings/kotlin + ./gradlew publish --no-daemon --no-parallel + env: + ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} + + - name: Dry run - Local publish only + if: github.event_name != 'release' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run == 'true') + run: | + cd bindings/kotlin + echo "Dry run: Publishing to local Maven repository only" + ./gradlew publishToMavenLocal --no-daemon --no-parallel + env: + ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} diff --git a/Makefile b/Makefile index ccaa3c5e1..bd6164816 100644 --- a/Makefile +++ b/Makefile @@ -105,9 +105,9 @@ bindings-examples-format: ## Format all bindings examples define build_binding cargo build -p iota-sdk-ffi --lib --release; \ case "$$(uname -s)" in \ - Darwin) LIB_EXT=".dylib" ;; \ - Linux) LIB_EXT=".so" ;; \ - MINGW*|MSYS*|CYGWIN*|Windows_NT) LIB_EXT=".dll" ;; \ + Darwin) LIB_PREFIX="lib"; LIB_EXT=".dylib" ;; \ + Linux) LIB_PREFIX="lib"; LIB_EXT=".so" ;; \ + MINGW*|MSYS*|CYGWIN*|Windows_NT) LIB_PREFIX=""; LIB_EXT=".dll" ;; \ *) echo "Unsupported platform"; exit 1 ;; \ esac; endef @@ -116,21 +116,27 @@ endef go: ## Build Go bindings @printf "Building Go bindings...\n" @$(build_binding) \ - uniffi-bindgen-go --library target/release/libiota_sdk_ffi$${LIB_EXT} --out-dir bindings/go --no-format || exit $$? + LIB_NAME="$${LIB_PREFIX}iota_sdk_ffi$${LIB_EXT}"; \ + uniffi-bindgen-go --library target/release/$${LIB_NAME} --out-dir bindings/go --no-format || exit $$? .PHONY: kotlin kotlin: ## Build Kotlin bindings @printf "Building Kotlin bindings...\n" @$(build_binding) \ - cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi$${LIB_EXT}" --language kotlin --out-dir bindings/kotlin/lib --no-format -c bindings/kotlin/uniffi.toml || exit $$?; \ - cp target/release/libiota_sdk_ffi$${LIB_EXT} bindings/kotlin/lib/ + printf "Built library with LIB_PREFIX=$${LIB_PREFIX}, LIB_EXT=$${LIB_EXT}\n"; \ + LIB_NAME="$${LIB_PREFIX}iota_sdk_ffi$${LIB_EXT}"; \ + printf "Checking if library exists: target/release/$${LIB_NAME}\n"; \ + test -f "target/release/$${LIB_NAME}" || (echo "Library not found!" && exit 1); \ + cargo run --bin iota_sdk_bindings -- generate --library "target/release/$${LIB_NAME}" --language kotlin --out-dir bindings/kotlin/lib --no-format -c bindings/kotlin/uniffi.toml || exit $$?; \ + cp target/release/$${LIB_NAME} bindings/kotlin/lib/ .PHONY: python python: ## Build Python bindings @printf "Building Python bindings...\n" @$(build_binding) \ - cargo run --bin iota_sdk_bindings -- generate --library "target/release/libiota_sdk_ffi$${LIB_EXT}" --language python --out-dir bindings/python/lib --no-format || exit $$?; \ - cp target/release/libiota_sdk_ffi$${LIB_EXT} bindings/python/lib/ + LIB_NAME="$${LIB_PREFIX}iota_sdk_ffi$${LIB_EXT}"; \ + cargo run --bin iota_sdk_bindings -- generate --library "target/release/$${LIB_NAME}" --language python --out-dir bindings/python/lib --no-format || exit $$?; \ + cp target/release/$${LIB_NAME} bindings/python/lib/ .PHONY: go-example go-example: ## Run a specific Go example. Usage: make go-example example diff --git a/bindings/kotlin/README.md b/bindings/kotlin/README.md index 1e056f69f..e1c5c6da3 100644 --- a/bindings/kotlin/README.md +++ b/bindings/kotlin/README.md @@ -28,3 +28,46 @@ make kotlin ```sh make kotlin-example chain_id ``` + +## Publishing to Maven Central + +### Publishing + +For snapshot releases, set the version in `build.gradle.kts` to end with `-SNAPSHOT`. + +#### Dry Run Testing + +To test the publishing process without actually publishing to Maven Central: + +1. Go to the Actions tab in GitHub +2. Select "Publish to Maven Central" workflow +3. Click "Run workflow" +4. Check "Dry run - publish to local Maven repo only" +5. Optionally specify a version +6. Run the workflow + +This will build all artifacts, sign them, and publish to your local Maven repository (`~/.m2/repository`) for verification, without uploading to Maven Central. + +**Note:** The dry run uses the same GPG signing secrets as real publishing, but skips the Sonatype upload step. + +#### Local Testing + +You can also test the publishing process locally (signing is optional): + +**Complete local testing script:** + +```bash +#!/bin/bash +cd bindings/kotlin + +# Test publish to Maven Local (no GPG required) +./gradlew clean publishToMavenLocal --info + +# Verify the results +echo "Published artifacts:" +find ~/.m2/repository/org/iota -name "*.jar" -o -name "*.pom" | head -5 + +echo "JAR contents check:" +jar -tf ~/.m2/repository/org/iota/iota-sdk-jvm/1.0-SNAPSHOT/iota-sdk-jvm-1.0-SNAPSHOT.jar | grep -E "(libiota_sdk_ffi|iota_sdk)" | wc -l +echo "files found (should be > 1)" +``` diff --git a/bindings/kotlin/build.gradle.kts b/bindings/kotlin/build.gradle.kts index 8be08cc7b..4708d6df8 100644 --- a/bindings/kotlin/build.gradle.kts +++ b/bindings/kotlin/build.gradle.kts @@ -1,10 +1,13 @@ import com.ncorti.ktfmt.gradle.tasks.* +import java.util.Base64 plugins { kotlin("jvm") version "1.9.24" kotlin("plugin.serialization") version "1.9.24" id("com.ncorti.ktfmt.gradle") version "0.25.0" application + `maven-publish` + signing } group = "org.iota" @@ -105,3 +108,68 @@ tasks.register("compileWithErrors") { } } } + +publishing { + publications { + create("maven") { + from(components["java"]) + pom { + name.set("IOTA SDK Kotlin Bindings") + description.set("Kotlin bindings for the IOTA SDK") + url.set("https://github.com/iotaledger/iota-rust-sdk") + licenses { + license { + name.set("Apache-2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + id.set("iotaledger") + name.set("IOTA Foundation") + email.set("contact@iota.org") + } + } + scm { + connection.set("scm:git:git://github.com/iotaledger/iota-rust-sdk.git") + developerConnection.set("scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git") + url.set("https://github.com/iotaledger/iota-rust-sdk") + } + } + } + } + repositories { + maven { + name = "ossrh" + url = + uri( + if (version.toString().endsWith("SNAPSHOT")) { + "https://s01.oss.sonatype.org/content/repositories/snapshots/" + } else { + "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + } + ) + val sonatypeUsername = + providers.environmentVariable("ORG_GRADLE_PROJECT_SONATYPE_USERNAME") + val sonatypePassword = + providers.environmentVariable("ORG_GRADLE_PROJECT_SONATYPE_PASSWORD") + if (sonatypeUsername.isPresent && sonatypePassword.isPresent) { + credentials { + username = sonatypeUsername.get() + password = sonatypePassword.get() + } + } + } + } +} + +signing { + val signingKeyEncoded = + providers.environmentVariable("ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY") + val signingPassword = providers.environmentVariable("ORG_GRADLE_PROJECT_SIGNING_PASSWORD") + if (signingKeyEncoded.isPresent && signingPassword.isPresent) { + val signingKey = String(Base64.getDecoder().decode(signingKeyEncoded.get())) + useInMemoryPgpKeys(signingKey, signingPassword.get()) + sign(publishing.publications["maven"]) + } +} From 557385ce3dc0b4e778f5cafd813a521aed4aec67 Mon Sep 17 00:00:00 2001 From: Thoralf-M Date: Fri, 7 Nov 2025 11:32:43 +0200 Subject: [PATCH 2/4] let's goo --- .github/workflows/maven-central-publish.yml | 22 ++--- bindings/kotlin/build.gradle.kts | 84 +++++++------------ .../gradle/wrapper/gradle-wrapper.properties | 2 +- bindings/kotlin/gradlew | 5 +- bindings/kotlin/gradlew.bat | 3 +- bindings/kotlin/settings.gradle.kts | 2 +- 6 files changed, 44 insertions(+), 74 deletions(-) diff --git a/.github/workflows/maven-central-publish.yml b/.github/workflows/maven-central-publish.yml index 88620023b..9e9e4bbe1 100644 --- a/.github/workflows/maven-central-publish.yml +++ b/.github/workflows/maven-central-publish.yml @@ -13,7 +13,7 @@ on: dry_run: description: "Dry run - publish to local Maven repo only" required: false - default: true + default: false type: boolean jobs: @@ -122,22 +122,22 @@ jobs: sed -i "s/version = .*/version = \"${{ github.event.inputs.version }}\"/" build.gradle.kts - name: Publish to Maven Central - if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false') + if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == false) run: | cd bindings/kotlin - ./gradlew publish --no-daemon --no-parallel + ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache env: - ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }} - ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }} - ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }} - ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} + ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} - name: Dry run - Local publish only - if: github.event_name != 'release' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run == 'true') + if: github.event_name != 'release' && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run == true) run: | cd bindings/kotlin echo "Dry run: Publishing to local Maven repository only" - ./gradlew publishToMavenLocal --no-daemon --no-parallel + ./gradlew publishToMavenLocal --no-daemon --no-parallel --no-configuration-cache env: - ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }} - ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} + ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }} + ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} diff --git a/bindings/kotlin/build.gradle.kts b/bindings/kotlin/build.gradle.kts index 4708d6df8..38feae059 100644 --- a/bindings/kotlin/build.gradle.kts +++ b/bindings/kotlin/build.gradle.kts @@ -5,14 +5,14 @@ plugins { kotlin("jvm") version "1.9.24" kotlin("plugin.serialization") version "1.9.24" id("com.ncorti.ktfmt.gradle") version "0.25.0" + id("com.vanniktech.maven.publish") version "0.30.0" application - `maven-publish` signing } group = "org.iota" -version = "1.0-SNAPSHOT" +version = "0.0.1-alpha.1" repositories { mavenCentral() } @@ -88,8 +88,6 @@ tasks.withType { "-Xno-receiver-assertions", // Add these flags to help with recursive type issues "-Xtype-enhancement-improvements-strict-mode=false", - "-Xskip-runtime-version-check", - "-Xlenient-function-type-parameter-checks", ) allWarningsAsErrors = false suppressWarnings = true @@ -109,67 +107,43 @@ tasks.register("compileWithErrors") { } } -publishing { - publications { - create("maven") { - from(components["java"]) - pom { - name.set("IOTA SDK Kotlin Bindings") - description.set("Kotlin bindings for the IOTA SDK") - url.set("https://github.com/iotaledger/iota-rust-sdk") - licenses { - license { - name.set("Apache-2.0") - url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") - } - } - developers { - developer { - id.set("iotaledger") - name.set("IOTA Foundation") - email.set("contact@iota.org") - } - } - scm { - connection.set("scm:git:git://github.com/iotaledger/iota-rust-sdk.git") - developerConnection.set("scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git") - url.set("https://github.com/iotaledger/iota-rust-sdk") - } +mavenPublishing { + publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL) + signAllPublications() + + coordinates("org.iota", "iota-sdk", version.toString()) + + pom { + name.set("IOTA SDK Kotlin Bindings") + description.set("Kotlin bindings for the IOTA SDK") + url.set("https://github.com/iotaledger/iota-rust-sdk") + licenses { + license { + name.set("Apache-2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") } } - } - repositories { - maven { - name = "ossrh" - url = - uri( - if (version.toString().endsWith("SNAPSHOT")) { - "https://s01.oss.sonatype.org/content/repositories/snapshots/" - } else { - "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - } - ) - val sonatypeUsername = - providers.environmentVariable("ORG_GRADLE_PROJECT_SONATYPE_USERNAME") - val sonatypePassword = - providers.environmentVariable("ORG_GRADLE_PROJECT_SONATYPE_PASSWORD") - if (sonatypeUsername.isPresent && sonatypePassword.isPresent) { - credentials { - username = sonatypeUsername.get() - password = sonatypePassword.get() - } + developers { + developer { + id.set("iotaledger") + name.set("IOTA Foundation") + email.set("contact@iota.org") } } + scm { + connection.set("scm:git:git://github.com/iotaledger/iota-rust-sdk.git") + developerConnection.set("scm:git:ssh://github.com/iotaledger/iota-rust-sdk.git") + url.set("https://github.com/iotaledger/iota-rust-sdk") + } } } signing { - val signingKeyEncoded = - providers.environmentVariable("ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY") - val signingPassword = providers.environmentVariable("ORG_GRADLE_PROJECT_SIGNING_PASSWORD") + val signingKeyEncoded = providers.environmentVariable("ORG_GRADLE_PROJECT_signingInMemoryKey") + val signingPassword = + providers.environmentVariable("ORG_GRADLE_PROJECT_signingInMemoryKeyPassword") if (signingKeyEncoded.isPresent && signingPassword.isPresent) { val signingKey = String(Base64.getDecoder().decode(signingKeyEncoded.get())) useInMemoryPgpKeys(signingKey, signingPassword.get()) - sign(publishing.publications["maven"]) } } diff --git a/bindings/kotlin/gradle/wrapper/gradle-wrapper.properties b/bindings/kotlin/gradle/wrapper/gradle-wrapper.properties index ff23a68d7..bad7c2462 100644 --- a/bindings/kotlin/gradle/wrapper/gradle-wrapper.properties +++ b/bindings/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/bindings/kotlin/gradlew b/bindings/kotlin/gradlew index 23d15a936..adff685a0 100755 --- a/bindings/kotlin/gradlew +++ b/bindings/kotlin/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/bindings/kotlin/gradlew.bat b/bindings/kotlin/gradlew.bat index db3a6ac20..c4bdd3ab8 100644 --- a/bindings/kotlin/gradlew.bat +++ b/bindings/kotlin/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH= @rem Execute Gradle -"%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" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/bindings/kotlin/settings.gradle.kts b/bindings/kotlin/settings.gradle.kts index d6ea9d2f3..a77eeed9d 100644 --- a/bindings/kotlin/settings.gradle.kts +++ b/bindings/kotlin/settings.gradle.kts @@ -1,4 +1,4 @@ -rootProject.name = "iota-sdk-jvm" +rootProject.name = "iota-sdk" include(":lib") From d04f918f22eeb7bce998236b3054f536ab890e59 Mon Sep 17 00:00:00 2001 From: Thoralf-M Date: Fri, 7 Nov 2025 15:18:10 +0200 Subject: [PATCH 3/4] dry run default, format --- .github/workflows/maven-central-publish.yml | 2 +- bindings/kotlin/build.gradle.kts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-central-publish.yml b/.github/workflows/maven-central-publish.yml index 9e9e4bbe1..d5d59cfca 100644 --- a/.github/workflows/maven-central-publish.yml +++ b/.github/workflows/maven-central-publish.yml @@ -13,7 +13,7 @@ on: dry_run: description: "Dry run - publish to local Maven repo only" required: false - default: false + default: true type: boolean jobs: diff --git a/bindings/kotlin/build.gradle.kts b/bindings/kotlin/build.gradle.kts index 38feae059..4359a82de 100644 --- a/bindings/kotlin/build.gradle.kts +++ b/bindings/kotlin/build.gradle.kts @@ -110,9 +110,9 @@ tasks.register("compileWithErrors") { mavenPublishing { publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost.CENTRAL_PORTAL) signAllPublications() - + coordinates("org.iota", "iota-sdk", version.toString()) - + pom { name.set("IOTA SDK Kotlin Bindings") description.set("Kotlin bindings for the IOTA SDK") From a39d9fad090851ba8da4692bf15d54ad8841bcda Mon Sep 17 00:00:00 2001 From: Thoralf-M Date: Fri, 7 Nov 2025 19:13:19 +0200 Subject: [PATCH 4/4] clean up and make CI work --- .github/workflows/maven-central-publish.yml | 10 ++-------- Makefile | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/maven-central-publish.yml b/.github/workflows/maven-central-publish.yml index d5d59cfca..400a74e27 100644 --- a/.github/workflows/maven-central-publish.yml +++ b/.github/workflows/maven-central-publish.yml @@ -1,9 +1,6 @@ name: Publish to Maven Central on: - # TODO: remove after testing - push: - branches: [ci/kotlin-release] workflow_dispatch: inputs: version: @@ -77,9 +74,6 @@ jobs: - name: Install Rust uses: dtolnay/rust-toolchain@stable - # - name: Build Rust library - # run: cargo build -p iota-sdk-ffi --lib --release - - name: Download native libraries uses: actions/download-artifact@v4 with: @@ -122,7 +116,7 @@ jobs: sed -i "s/version = .*/version = \"${{ github.event.inputs.version }}\"/" build.gradle.kts - name: Publish to Maven Central - if: github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == false) + if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'false') run: | cd bindings/kotlin ./gradlew publishAndReleaseToMavenCentral --no-daemon --no-parallel --no-configuration-cache @@ -133,7 +127,7 @@ jobs: ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.ORG_GRADLE_PROJECT_BASE64_ENCODED_ASCII_ARMORED_SIGNING_KEY }} - name: Dry run - Local publish only - if: github.event_name != 'release' && github.event_name != 'push' && (github.event_name != 'workflow_dispatch' || github.event.inputs.dry_run == true) + if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.dry_run == 'true') run: | cd bindings/kotlin echo "Dry run: Publishing to local Maven repository only" diff --git a/Makefile b/Makefile index bd6164816..5cb95f9ec 100644 --- a/Makefile +++ b/Makefile @@ -182,13 +182,13 @@ kotlin-examples: ## Run all Kotlin bindings examples .PHONY: kotlin-examples-format-check kotlin-examples-format-check: ## Check format of all Kotlin bindings examples cd bindings/kotlin; \ - ./gradlew KtfmtCheck || exit $$?; \ + ./gradlew KtfmtCheck --no-configuration-cache || exit $$?; \ cd - .PHONY: kotlin-examples-format kotlin-examples-format: ## Format all Kotlin bindings examples cd bindings/kotlin; \ - ./gradlew KtfmtFormat; \ + ./gradlew KtfmtFormat --no-configuration-cache; \ cd - .PHONY: python-example