From 6b86d2842890f13b67034ac2e630558442b09eac Mon Sep 17 00:00:00 2001 From: Carter Jernigan Date: Fri, 29 Jul 2022 09:12:54 -0400 Subject: [PATCH] [#95] Fix publishing all variants Previously just the multiplatform metadata was being published --- .github/workflows/deploy-release.yml | 4 ++-- .github/workflows/deploy-snapshot.yml | 4 ++-- README.md | 8 ++------ bip39-lib/build.gradle.kts | 4 +++- docs/PUBLISHING.md | 6 +++--- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-release.yml b/.github/workflows/deploy-release.yml index 6d5e85a..20d9baa 100644 --- a/.github/workflows/deploy-release.yml +++ b/.github/workflows/deploy-release.yml @@ -65,7 +65,7 @@ jobs: ORG_GRADLE_PROJECT_IS_SNAPSHOT: false ORG_GRADLE_PROJECT_ZCASH_ASCII_GPG_KEY: ${{ secrets.MAVEN_SIGNING_KEY_ASCII }} run: | - ./gradlew publishKotlinMultiplatformPublicationToMavenLocalRepository --no-parallel + ./gradlew publishAllPublicationsToMavenLocalRepository --no-parallel - name: Deploy to Maven Central timeout-minutes: 5 env: @@ -74,7 +74,7 @@ jobs: ORG_GRADLE_PROJECT_ZCASH_ASCII_GPG_KEY: ${{ secrets.MAVEN_SIGNING_KEY_ASCII }} ORG_GRADLE_PROJECT_IS_SNAPSHOT: false run: | - ./gradlew publishKotlinMultiplatformPublicationToMavenCentralRepository --no-parallel + ./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel - name: Collect Artifacts timeout-minutes: 1 if: ${{ always() }} diff --git a/.github/workflows/deploy-snapshot.yml b/.github/workflows/deploy-snapshot.yml index 0254a65..748af62 100644 --- a/.github/workflows/deploy-snapshot.yml +++ b/.github/workflows/deploy-snapshot.yml @@ -73,7 +73,7 @@ jobs: env: ORG_GRADLE_PROJECT_IS_SNAPSHOT: true run: | - ./gradlew publishKotlinMultiplatformPublicationToMavenLocalRepository --no-parallel + ./gradlew publishAllPublicationsToMavenLocalRepository --no-parallel - name: Deploy to Maven Central timeout-minutes: 5 env: @@ -81,7 +81,7 @@ jobs: ORG_GRADLE_PROJECT_ZCASH_MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} ORG_GRADLE_PROJECT_IS_SNAPSHOT: true run: | - ./gradlew publishKotlinMultiplatformPublicationToMavenCentralRepository --no-parallel + ./gradlew publishAllPublicationsToMavenCentralRepository --no-parallel - name: Collect Artifacts timeout-minutes: 1 if: ${{ always() }} diff --git a/README.md b/README.md index 608d905..ed80e67 100644 --- a/README.md +++ b/README.md @@ -138,9 +138,8 @@ val mnemonicCode = MnemonicCode(WordCount.COUNT_24, languageCode = Locale.GERMAN val mnemonicCode = MnemonicCode(WordCount.COUNT_24, languageCode = Locale.ENGLISH.language) ``` -## Test Results -![Screenshot from 2020-06-06 15-14-39](https://user-images.githubusercontent.com/1699841/83952728-afbfaa80-a808-11ea-988c-3fb764dc4970.png) - +# Known issues + * When publishing the library, a Gradle warning will be printed. This is a [known issue](https://youtrack.jetbrains.com/issue/KT-46466) in Kotlin Multiplatform and can be safely ignored. ## Credits * [zcash/ebfull](https://github.com/ebfull) - Zcash core dev and BIP-0039 co-author who inspired creation of this library @@ -148,6 +147,3 @@ val mnemonicCode = MnemonicCode(WordCount.COUNT_24, languageCode = Locale.ENGLIS * [Trezor](https://github.com/trezor/python-mnemonic/blob/master/vectors.json) - for their OG [test data set](https://github.com/trezor/python-mnemonic/blob/master/vectors.json) that has excellent edge cases * [Cole Barnes](http://cryptofreek.org/2012/11/29/pbkdf2-pure-java-implementation/) - whose PBKDF2SHA512 Java implementation is floating around _everywhere_ online * [Ken Sedgwick](https://github.com/ksedgwic) - who adapted Cole Barnes' work to use SHA-512 - -## License -MIT diff --git a/bip39-lib/build.gradle.kts b/bip39-lib/build.gradle.kts index 51b2672..a98425a 100644 --- a/bip39-lib/build.gradle.kts +++ b/bip39-lib/build.gradle.kts @@ -71,7 +71,9 @@ publishing { withType { artifact(tasks.getByName("javadocJar")) - artifactId = myArtifactId + // Artifact id is tricky. Gradle uses the project name by default, but Kotlin multiplatform needs to add + // platform specific suffixes. Doing a partial replacement is the way to rename the artifact. + artifactId = artifactId.replace(project.name, myArtifactId) groupId = "cash.z.ecc.android" version = if (isSnapshot) { "$myVersion-SNAPSHOT" diff --git a/docs/PUBLISHING.md b/docs/PUBLISHING.md index d1313a0..f6105b8 100644 --- a/docs/PUBLISHING.md +++ b/docs/PUBLISHING.md @@ -70,12 +70,12 @@ See [ci.md](ci.md), which describes the continuous integration workflow for depl 2. Build locally * This will install the files in your local maven repo at `~/.m2/repository/cash/z/ecc/android/` ```zsh -./gradlew publishKotlinMultiplatformPublicationToMavenLocalRepository --no-parallel +./gradlew publishAllPublicationsToMavenLocalRepository ``` 3. Publish via the following command: - 1. Snapshot: `./gradlew publishKotlinMultiplatformPublicationToMavenCentralRepository -PIS_SNAPSHOT=true` + 1. Snapshot: `./gradlew publishAllPublicationsToMavenCentralRepository -PIS_SNAPSHOT=true` 2. Release - 1. `./gradlew publishKotlinMultiplatformPublicationToMavenCentralRepository -PIS_SNAPSHOT=false` + 1. `./gradlew publishAllPublicationsToMavenCentralRepository -PIS_SNAPSHOT=false` 2. Log into the Sonatype portal to complete the process of closing and releasing the repository. Note: