From aa72ac5747a7f633920f30daaf56ee75aae912a4 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Wed, 2 Mar 2022 15:30:27 +0100 Subject: [PATCH] [#13016] Pass opensea key from env Signed-off-by: andrey --- ci/Jenkinsfile.android | 2 +- ci/Jenkinsfile.combined | 2 +- ci/Jenkinsfile.ios | 2 +- ci/Jenkinsfile.nix-cache | 2 +- nix/mobile/android/release.nix | 2 +- nix/mobile/ios/status-go-shell.nix | 2 +- nix/status-go/mobile/build.nix | 19 ++++++++++++++++++- scripts/release-android.sh | 3 +++ status-go-version.json | 6 +++--- 9 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ci/Jenkinsfile.android b/ci/Jenkinsfile.android index 313f0d5339..2ea163cd50 100644 --- a/ci/Jenkinsfile.android +++ b/ci/Jenkinsfile.android @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.3.3' +library 'status-jenkins-lib@v1.3.5' pipeline { agent { label 'linux && x86_64 && nix-2.3' } diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index 8b884d7ae2..6e1a007f68 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.3.3' +library 'status-jenkins-lib@v1.3.5' pipeline { agent { label 'linux' } diff --git a/ci/Jenkinsfile.ios b/ci/Jenkinsfile.ios index fbc669c311..8ca8fb5c11 100644 --- a/ci/Jenkinsfile.ios +++ b/ci/Jenkinsfile.ios @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.3.3' +library 'status-jenkins-lib@v1.3.5' pipeline { agent { label 'macos && x86_64 && nix-2.3 && xcode-12.5' } diff --git a/ci/Jenkinsfile.nix-cache b/ci/Jenkinsfile.nix-cache index 8f90de3241..5486909e6c 100644 --- a/ci/Jenkinsfile.nix-cache +++ b/ci/Jenkinsfile.nix-cache @@ -1,4 +1,4 @@ -library 'status-jenkins-lib@v1.3.3' +library 'status-jenkins-lib@v1.3.5' pipeline { agent { label params.AGENT_LABEL } diff --git a/nix/mobile/android/release.nix b/nix/mobile/android/release.nix index 6ff9136ca2..afeae2fe24 100644 --- a/nix/mobile/android/release.nix +++ b/nix/mobile/android/release.nix @@ -85,7 +85,7 @@ in stdenv.mkDerivation rec { ANDROID_NDK_ROOT = "${androidPkgs.ndk}"; # Used by the Android Gradle build script in android/build.gradle - STATUS_GO_ANDROID_LIBDIR = "${status-go}"; + STATUS_GO_ANDROID_LIBDIR = status-go { inherit secretsFile; }; phases = [ "unpackPhase" "secretsPhase" "keystorePhase" diff --git a/nix/mobile/ios/status-go-shell.nix b/nix/mobile/ios/status-go-shell.nix index 4b4691b62d..177fa3b71b 100644 --- a/nix/mobile/ios/status-go-shell.nix +++ b/nix/mobile/ios/status-go-shell.nix @@ -7,7 +7,7 @@ mkShell { shellHook = '' - export STATUS_GO_IOS_LIBDIR=${status-go}/Statusgo.framework + export STATUS_GO_IOS_LIBDIR=${status-go {}}/Statusgo.framework RCTSTATUS_DIR="$STATUS_REACT_HOME/modules/react-native-status/ios/RCTStatus" targetBasename='Statusgo.framework' diff --git a/nix/status-go/mobile/build.nix b/nix/status-go/mobile/build.nix index e77a6e3de6..a05dcc5b5d 100644 --- a/nix/status-go/mobile/build.nix +++ b/nix/status-go/mobile/build.nix @@ -8,6 +8,9 @@ , goBuildLdFlags ? [ ] , outputFileName ? "status-go-${source.shortRev}-${platform}.aar" }: +# Path to the file containing secret environment variables +{ secretsFile ? "" }: + let inherit (stdenv) isDarwin; inherit (lib) @@ -34,6 +37,18 @@ in buildGo116Package { # Fixes Cgo related build failures (see https://github.com/NixOS/nixpkgs/issues/25959 ) hardeningDisable = [ "fortify" ]; + phases = [ + "unpackPhase" "secretsPhase" "configurePhase" + "buildPhase" "installPhase" "fixupPhase" + ]; + + # if secretsFile is not set we use generate keystore + secretsPhase = if (secretsFile != "") then '' + source "${secretsFile}" + '' else '' + echo "No secrets provided!" + ''; + # Ensure XCode is present for iOS build, instead of failing at the end of the build preConfigure = optionalString (isDarwin && platform == "ios") utils.enforceXCodeAvailable; @@ -54,7 +69,9 @@ in buildGo116Package { # Build the Go library using gomobile for each of the configured platforms buildPhase = let - ldFlags = [ "-extldflags=-Wl,--allow-multiple-definition" ] ++ goBuildLdFlags; + ldFlags = [ "-extldflags=-Wl,--allow-multiple-definition" ] + ++ lib.optionals (secretsFile != "") ["-X node.OpenseaKeyFromEnv=$OPENSEA_API_KEY"] + ++ goBuildLdFlags; CGO_LDFLAGS = concatStringsSep " " ldFlags; in '' runHook preBuild diff --git a/scripts/release-android.sh b/scripts/release-android.sh index 421b092d58..6077551e4a 100755 --- a/scripts/release-android.sh +++ b/scripts/release-android.sh @@ -52,6 +52,9 @@ fi if [[ -n "${INFURA_TOKEN}" ]]; then append_env_export 'INFURA_TOKEN' fi +if [[ -n "${OPENSEA_API_KEY}" ]]; then + append_env_export 'OPENSEA_API_KEY' +fi # Used by Clojure at compile time for remove import of react-native-notifications for fdroid release if [[ -n "${READER_FEATURES}" ]]; then diff --git a/status-go-version.json b/status-go-version.json index 255f4fa4f9..67012b7623 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.96.1", - "commit-sha1": "01b6988260a676fdb492e427c8d336a0df229a07", - "src-sha256": "1b2cx114v1pziy302v0bzf1cw4p5fm61cdfdj6b43d04avmyrnnp" + "version": "v0.96.2", + "commit-sha1": "12ccff417d95a0aef9736b811ea00341390dd1d5", + "src-sha256": "1g6p239l1k8wv52x5gz63jql4piyy52qj3a795h9ka1lawqsxq8h" }