From 952f3ceacff2ccb4e3418ab7a34e7ceb6701c8e2 Mon Sep 17 00:00:00 2001 From: "artem.ivanov" Date: Mon, 2 Mar 2020 17:12:33 +0300 Subject: [PATCH] IS-1495: Release Indy SDK 1.14.3 - build DEB's using cargo deb Signed-off-by: artem.ivanov --- Jenkinsfile.cd | 43 ++++++++++++++++++++++-------------- ci/deb-build-and-upload.sh | 20 ++++++++--------- cli/Cargo.toml | 22 +++++++++++++++++++ libindy/Cargo.toml | 45 ++++++++++++++++++++++++++++++++++---- libnullpay/Cargo.toml | 20 +++++++++++++++++ vcx/libvcx/Cargo.toml | 31 +++++++++++++++++--------- 6 files changed, 140 insertions(+), 41 deletions(-) diff --git a/Jenkinsfile.cd b/Jenkinsfile.cd index 99f7c4ac11..babe122528 100644 --- a/Jenkinsfile.cd +++ b/Jenkinsfile.cd @@ -310,7 +310,8 @@ def linuxLibindyBuild(file, env_name, network_name, full_testing) { cargo build --release --features "fatal_warnings sodium_static" ''' - stash includes: 'libindy/target/release/libindy.so,libindy/target/release/libindy.a', name: "LibindyBuildResult${env_name}" + stash includes: 'libindy/target/release/libindy.so', name: "LibindyBuildResult${env_name}" + stash includes: 'libindy/target/release/libindy.a', name: "LibindyDevBuildResult${env_name}" } sh "cp libindy/target/release/libindy.so wrappers/java/lib" @@ -1040,6 +1041,7 @@ def linuxPublishing(file, env_name, build_wrappers) { testEnv = buildTestEnv(file, env_name) libindyDebPublishing(testEnv, libindyVersion, env_name) + libindyDevDebPublishing(testEnv, libindyVersion, env_name) libnullpayDebPublishing(testEnv, env_name) libvcxDebPublishing(testEnv, env_name) libindyCliDebPublishing(testEnv, libindyVersion, env_name) // Note that last deb publishing should pass resetCache = true inside @@ -1283,10 +1285,18 @@ def libindyDebPublishing(testEnv, version, env_name) { debPublishing(testEnv, "libindy", "libindy", version, "LibindyBuildResult${env_name}", "libindyDebs${env_name}", env_name) } +def libindyDevDebPublishing(testEnv, version, env_name) { + echo 'Publish Libindy Dev deb files to Apt' + + setLibindyDependencyVersion("libindy/Cargo.toml") + + debPublishing(testEnv, "libindy", "libindy-dev", version, "LibindyDevBuildResult${env_name}", "libindyDevDebs${env_name}", env_name) +} + def libindyCliDebPublishing(testEnv, version, env_name) { echo 'Publish Indy Cli deb files to Apt' - setLibindyDependencyVersion("cli/debian/control") + setLibindyDependencyVersion("cli/Cargo.toml") debPublishing(testEnv, "cli", "indy-cli", version, "IndyCliBuildResult${env_name}", "libindyCliDebs${env_name}", env_name, true) } @@ -1296,7 +1306,7 @@ def libnullpayDebPublishing(testEnv, env_name) { def libnullpayVersion = getSrcVersion("libnullpay") - setLibindyDependencyVersion("libnullpay/debian/control") + setLibindyDependencyVersion("libnullpay/Cargo.toml") debPublishing(testEnv, "libnullpay", "libnullpay", libnullpayVersion, "LibnullpayBuildResult${env_name}", "libnullpayDebs${env_name}", env_name) } @@ -1306,7 +1316,7 @@ def libvcxDebPublishing(testEnv, env_name) { def libvcxVersion = getSrcVersion("vcx/libvcx") - setLibindyDependencyVersion("vcx/libvcx/debian/control") + setLibindyDependencyVersion("vcx/libvcx/Cargo.toml") debPublishing(testEnv, "vcx/libvcx", "libvcx", libvcxVersion, "LibvcxBuildResult${env_name}", "libvcxDebs${env_name}", env_name) } @@ -1315,7 +1325,7 @@ def setLibindyDependencyVersion(file) { def libindyVersion = getSrcVersion("libindy") def replaceVersion = "$libindyVersion~$env.BUILD_NUMBER" - sh "sed -i -e \"s/^\\(Depends: .*libindy\\)\\(\\s*[,]\\{,1\\}.*\\)/\\1 (= $replaceVersion)\\2/\" $file" + sh "sed -i -E -e \"s/depends = \\\"libindy \\(= [0-9,.]+\\)/depends = \\\"libindy \\(= $replaceVersion\\)/g\" $file" } def debPublishing(testEnv, directory, packageName, version, inStashName, outStashName, env_name, resetCache = false) { @@ -1326,7 +1336,7 @@ def debPublishing(testEnv, directory, packageName, version, inStashName, outStas testEnv.inside { sh "cp ci/deb-build-and-upload.sh $directory && chmod -R 755 $directory/*.sh" - def suffix = "~$env.BUILD_NUMBER" + def package_version = "$version~$env.BUILD_NUMBER" def package_type = ubuntuPakageTypes[env_name] unstash name: inStashName @@ -1334,7 +1344,7 @@ def debPublishing(testEnv, directory, packageName, version, inStashName, outStas def extraFlags = resetCache ? "" : "--no-reset-cache" withCredentials([file(credentialsId: 'SovrinRepoSSHKey', variable: 'sovrin_key')]) { - sh "cd $directory && ./deb-build-and-upload.sh $packageName $version $env.BRANCH_NAME $suffix $SOVRIN_SDK_REPO_NAME $SOVRIN_REPO_HOST $sovrin_key $package_type $extraFlags" + sh "cd $directory && ./deb-build-and-upload.sh $packageName $package_version $env.BRANCH_NAME $SOVRIN_SDK_REPO_NAME $SOVRIN_REPO_HOST $sovrin_key $package_type $extraFlags" if (env.BRANCH_NAME == 'rc') { stash includes: "$directory/debs/*", name: outStashName @@ -1464,6 +1474,7 @@ def publishingRCtoStable() { echo "Moving ${env_name} RC artifacts to Stable: libindy" publishLibindyDebRCtoStable(testEnv, libindyVersion, env_name) + publishLibindyDevDebRCtoStable(testEnv, libindyVersion, env_name) echo 'Moving Ubuntu RC artifacts to Stable: python wrapper' pythonWrapperPublishing(testEnv, true, 'wrappers/python', 'libindy') @@ -1687,24 +1698,28 @@ def copyFilesFromRcToStable(src, target) { } def publishLibindyDebRCtoStable(testEnv, version, env_name) { - publishDebRCtoStable(testEnv, "libindy", "libindy", version, "libindyDebs", true, env_name) + publishDebRCtoStable(testEnv, "libindy", "libindy", version, "libindyDebs", env_name) +} + +def publishLibindyDevDebRCtoStable(testEnv, version, env_name) { + publishDebRCtoStable(testEnv, "libindy-dev", "libindy", version, "libindyDevDebs", env_name) } def publishLibindyCliDebRCtoStable(testEnv, version, env_name) { - publishDebRCtoStable(testEnv, "indy-cli", "cli", version, "libindyCliDebs", false, env_name) + publishDebRCtoStable(testEnv, "indy-cli", "cli", version, "libindyCliDebs", env_name) } def publishLibnullpayDebRCtoStable(testEnv, env_name) { def libnullpayVersion = getSrcVersion("libnullpay") - publishDebRCtoStable(testEnv, "libnullpay", "libnullpay", libnullpayVersion, "libnullpayDebs", false, env_name) + publishDebRCtoStable(testEnv, "libnullpay", "libnullpay", libnullpayVersion, "libnullpayDebs", env_name) } def publishLibvcxDebRCtoStable(testEnv, env_name) { def libvcxVersion = getSrcVersion("vcx/libvcx") - publishDebRCtoStable(testEnv, "libvcx", "vcx/libvcx", libvcxVersion, "libvcxDebs", false, env_name, true) + publishDebRCtoStable(testEnv, "libvcx", "vcx/libvcx", libvcxVersion, "libvcxDebs", env_name, true) } -def publishDebRCtoStable(testEnv, packageName, folder, version, stashName, moveDevArtifacts, env_name, resetCache = false) { +def publishDebRCtoStable(testEnv, packageName, folder, version, stashName, env_name, resetCache = false) { testEnv.inside { def rcFullVersion = "${version}~${env.BUILD_NUMBER}" def package_type = ubuntuPakageTypes[env_name] @@ -1718,10 +1733,6 @@ def publishDebRCtoStable(testEnv, packageName, folder, version, stashName, moveD sh "fakeroot deb-reversion -v $version $folder/debs/\"$packageName\"_\"$rcFullVersion\"_amd64.deb" - if (moveDevArtifacts) { - sh "fakeroot deb-reversion -v $version $folder/debs/\"$packageName\"-dev_\"$rcFullVersion\"_amd64.deb" - } - def extraFlags = resetCache ? "" : "--no-reset-cache" withCredentials([file(credentialsId: 'SovrinRepoSSHKey', variable: 'sovrin_key')]) { diff --git a/ci/deb-build-and-upload.sh b/ci/deb-build-and-upload.sh index 08c2f82eb7..dbc7a699d2 100755 --- a/ci/deb-build-and-upload.sh +++ b/ci/deb-build-and-upload.sh @@ -4,34 +4,32 @@ set -e set -x if [ "$1" = "--help" ] ; then - echo "Usage: " + echo "Usage: " return fi package="$1" version="$2" type="$3" -suffix="$4" -repo="$5" -host="$6" -key="$7" -package_type="$8" -extra_flags="$9" +repo="$4" +host="$5" +key="$6" +package_type="$7" +extra_flags="$8" [ -z $package ] && exit 1 [ -z $version ] && exit 2 [ -z $type ] && exit 3 -[ -z $suffix ] && exit 4 [ -z $repo ] && exit 5 [ -z $host ] && exit 6 [ -z $key ] && exit 7 [ -z $package_type ] && exit 8 -sed -i -E -e 'H;1h;$!d;x' -e "s/$package ([(,),0-9,.]+)/$package ($version$suffix)/" debian/changelog +sed -i -E -e "s/provides = \"${package} \(= [(,),0-9,.]+\)\"/provides = \"${package} \(= ${version}\)\"/g" Cargo.toml sed -i -e "s/RELEASE=\(%RELEASE%\)/RELEASE=$type/" debian/postinst -dpkg-buildpackage -tc +cargo deb --no-build --deb-version ${version}-${package_type} --variant ${package}-${package_type} -mkdir debs && mv ../*.deb ./debs/ +mkdir debs && mv target/debian/*.deb ./debs/ ./sovrin-packaging/upload_debs.py ./debs $repo $type --distro=$package_type --host $host --ssh-key $key $extra_flags diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 72168edbdb..37eccb7b1b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -2,6 +2,11 @@ name = "indy-cli" version = "1.14.3" authors = ["Hyperledger Indy Contributors "] +license = "MIT/Apache-2.0" +description = """\ +This is the official command line interface for Indy SDK,\ +which provides a distributed-ledger-based foundation for self-sovereign\ +identity.""" edition = "2018" [features] @@ -30,3 +35,20 @@ serde_derive = "1.0.97" term = "0.4.6" rpassword = "1.0.0" indy = { version = "1.14.3", path = "../wrappers/rust/" } + +[package.metadata.deb] +depends = "libindy (= 1.14.3), libncursesw5-dev" +section = "devel" +priority = "optional" +assets = [ + ["target/release/indy-cli", "usr/bin/", "755"] +] +maintainer-scripts = "./debian" + +[package.metadata.deb.variants.indy-cli-xenial] +name = "indy-cli" +provides = "indy-cli (= 1.14.3)" + +[package.metadata.deb.variants.indy-cli-bionic] +name = "indy-cli" +provides = "indy-cli (= 1.14.3)" \ No newline at end of file diff --git a/libindy/Cargo.toml b/libindy/Cargo.toml index 64efa0e760..e11ed6b36b 100644 --- a/libindy/Cargo.toml +++ b/libindy/Cargo.toml @@ -82,12 +82,49 @@ name = "wallet" harness = false [package.metadata.deb] -provides = "libindy (= 1.14.3)" +extended-description = """\ +This is the official SDK for Hyperledger Indy, which provides a \ +distributed-ledger-based foundation for self-sovereign identity. \ +The major artifact of the SDK is a c-callable library; there are \ +also convenience wrappers for various programming languages. \ +All bugs, stories, and backlog for this project are managed through \ +Hyperledger's Jira in project IS (note that regular Indy tickets are \ +in the INDY project instead...). Also, join us on Jira's Rocket.Chat \ +at #indy-sdk to discuss.""" +section = "devel" +priority = "optional" +maintainer-scripts = "./debian" -[package.metadata.deb.variants.xenial] +[package.metadata.deb.variants.libindy-xenial] +provides = "libindy (= 1.14.3)" name = "libindy" depends = "libzmq5, libsodium18, libssl1.0.0" +assets = [ + ["target/release/libindy.so", "usr/lib/", "644"], +] -[package.metadata.deb.variants.bionic] +[package.metadata.deb.variants.libindy-bionic] +provides = "libindy (= 1.14.3)" name = "libindy" -depends = "libzmq5, libsodium23, libssl1.1" \ No newline at end of file +depends = "libzmq5, libsodium23, libssl1.1" +assets = [ + ["target/release/libindy.so", "usr/lib/", "644"], +] + +[package.metadata.deb.variants.libindy-dev-xenial] +provides = "libindy-dev (= 1.14.3)" +name = "libindy-dev" +depends = "libindy (= 1.14.3)" +assets = [ + ["include/*.h", "usr/include/indy/", "644"], + ["target/release/libindy.a", "usr/lib/", "644"], +] + +[package.metadata.deb.variants.libindy-dev-bionic] +provides = "libindy-dev (= 1.14.3)" +name = "libindy-dev" +depends = "libindy (= 1.14.3)" +assets = [ + ["include/*.h", "usr/include/indy/", "644"], + ["target/release/libindy.a", "usr/lib/", "644"], +] \ No newline at end of file diff --git a/libnullpay/Cargo.toml b/libnullpay/Cargo.toml index fb857ac050..b827a4d038 100644 --- a/libnullpay/Cargo.toml +++ b/libnullpay/Cargo.toml @@ -2,6 +2,9 @@ name = "null-payment-method" version = "1.14.3" authors = ["Hyperledger Indy Contributors "] +license = "MIT/Apache-2.0" +description = """\ +This is a simple plugin that can be used for development of applications that use Payments API of Indy SDK.""" build = "build.rs" [lib] @@ -30,3 +33,20 @@ indy = { version="1.14.3", path="../wrappers/rust" } [target.'cfg(target_os = "android")'.dependencies] android_logger = "0.5" + +[package.metadata.deb] +depends = "libindy (= 1.14.3)" +section = "devel" +priority = "optional" +assets = [ + ["target/release/libnullpay.so", "usr/lib/", "644"] +] +maintainer-scripts = "./debian" + +[package.metadata.deb.variants.libnullpay-xenial] +name = "libnullpay" +provides = "libnullpay (= 1.14.3)" + +[package.metadata.deb.variants.libnullpay-bionic] +name = "libnullpay" +provides = "libnullpay (= 1.14.3)" diff --git a/vcx/libvcx/Cargo.toml b/vcx/libvcx/Cargo.toml index 6e84df36e5..19f890dddc 100644 --- a/vcx/libvcx/Cargo.toml +++ b/vcx/libvcx/Cargo.toml @@ -64,20 +64,31 @@ serde_json = "1.0" serde_derive = "1.0" [package.metadata.deb] -maintainer = "Evernym, Inc." -copyright = "2018, Evernym Inc." -depends = "$auto, libindy (=1.14.3)" +depends = "libindy (= 1.14.3)" extended-description = """\ -This is Evernym's SDK for managing Verifiable Credential eXchange against an Indy network. For specific instructions on building see the README in the corresponding github repo https://github.com/evernym/sdk""" -section = "admin" -revision = "338ad01" +This is the official SDK for Hyperledger Indy, which provides a\ + distributed-ledger-based foundation for self-sovereign identity.\ + The major artifact of the SDK is a c-callable library; there are\ + also convenience wrappers for various programming languages.\ + All bugs, stories, and backlog for this project are managed through\ + Hyperledger's Jira in project IS (note that regular Indy tickets are\ + in the INDY project instead...). Also, join us on Jira's Rocket.Chat\ + at #indy-sdk to discuss.""" +section = "devel" priority = "optional" assets = [ - ["target/debug/libvcx.so.*", "usr/lib/", "644"], - ["include/vcx.h", "usr/share/libvcx/", "644"], - ["scripts/provision_agent_keys.py", "usr/share/libvcx/", "655"] + ["target/release/libvcx.so", "usr/lib/", "644"], + ["include/vcx.h", "usr/share/libvcx/", "644"] ] -maintainer-scripts = "./scripts" +maintainer-scripts = "./debian" + +[package.metadata.deb.variants.libvcx-xenial] +name = "libvcx" +provides = "libvcx (= 0.7.0)" + +[package.metadata.deb.variants.libvcx-bionic] +name = "libvcx" +provides = "libvcx (= 0.7.0)" [profile.release] debug = true