From 316e585e4c3b77475975559610db981885d302a4 Mon Sep 17 00:00:00 2001 From: Salomon BRYS Date: Mon, 6 Jul 2020 11:37:10 +0200 Subject: [PATCH] Rational ci (#3) * Only test when pushing on master OR when there's a PR * Added the bintray badge as well as the repository informations to README. * Do not re-launch CI when updating documentation, auto-publish when pushing a snapshot. * Update README.md Co-authored-by: Salomon BRYS --- .github/workflows/snapshot.yml | 6 ++++++ .github/workflows/test.yml | 11 +++++++++-- README.md | 15 ++++++++++++++- build.gradle.kts | 3 ++- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index a68932a..16e76f9 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -4,6 +4,12 @@ on: push: branches: - 'snapshot/*' + paths-ignore: + - '**.md' + - '**.adoc' + - '**/.gitignore' + - './github/**' + - '!./github/workflow/snapshot.yml' jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5809e22..64af9c2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,8 +2,15 @@ name: Check on: push: - branches-ignore: - - 'snapshot/*' + branches: + - 'master' + pull_request: + paths-ignore: + - '**.md' + - '**.adoc' + - '**/.gitignore' + - './github/**' + - '!./github/workflow/test.yml' jobs: diff --git a/README.md b/README.md index 1b9cdce..d503ba5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,19 @@ Kotlin/Multiplatform wrapper for Bitcoin Core's secp256k1 library. Targets: JVM, ## Installation +[ ![Download](https://api.bintray.com/packages/acinq/libs/secp256k1-kmp/images/download.svg) ](https://bintray.com/acinq/libs/secp256k1-kmp/0.1.0-1.4-M2/link) + +First, you need to add the ACINQ libraries repository: + +```kotlin +// build.gradle.kts +repositories { + maven(url = "https://dl.bintray.com/acinq/libs") +} +``` + +Then, the actual dependency depends on your targeted platform(s): + ### Multiplatform Add the `secp256k1` dependency to the common sourceSet, and the JNI dependencies to JVM and Android sourcesets: @@ -44,7 +57,7 @@ kotlin { Native targets include libsecp256k1, called through KMP's c-interop, simply add the `fr.acinq.secp256k1:secp256k1` dependency. -### JVM target & Android +### JVM targets & Android The JVM library uses JNI bindings for libsecp256k1, which is much faster than BouncyCastle. It will extract and load native bindings for your operating system in a temporary directory. diff --git a/build.gradle.kts b/build.gradle.kts index d353c87..8cda112 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -117,10 +117,11 @@ allprojects { if (bintrayUsername == null || bintrayApiKey == null) logger.warn("Skipping bintray configuration as bintrayUsername or bintrayApiKey is not defined") else { val btRepo = if (snapshotNumber != null) "snapshots" else "libs" + val btPublish = if (snapshotNumber != null) "1" else "0" repositories { maven { name = "bintray" - setUrl("https://api.bintray.com/maven/acinq/$btRepo/${rootProject.name}/;publish=0") + setUrl("https://api.bintray.com/maven/acinq/$btRepo/${rootProject.name}/;publish=$btPublish") credentials { username = bintrayUsername password = bintrayApiKey