Skip to content

Commit

Permalink
fix package script typo
Browse files Browse the repository at this point in the history
  • Loading branch information
nitesh authored and nitesh committed May 30, 2024
1 parent 7a861b5 commit 4fd76b9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 1 deletion.
20 changes: 20 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# reactnativecommunity/react-native-android:13.0
BUILDER_IMAGE="reactnativecommunity/react-native-android@sha256:4ff9c9f80da57c72284900fcfdbd079183e735684c62d7fafd3df50fdb895453"
CONTAINER_NAME="blixt_builder_container"
BLIXT_PATH=/blixt

docker run --rm -it --name $CONTAINER_NAME -v `pwd`:$BLIXT_PATH $BUILDER_IMAGE bash -c \
'echo -e "\n\n********************************\n*** Building Blixt...\n********************************\n" && \
cd /blixt ; yarn install --frozen-lockfile && \
cd /blixt/android ; ./gradlew app:assembleRelease && \
echo -e "\n\n********************************\n**** APKs and SHA256 Hashes\n********************************\n" && \
cd /blixt && \
for f in android/app/build/outputs/apk/release/*.apk;
do
RENAMED_FILENAME=$(echo $f | sed -e "s/app-/blixt-/" | sed -e "s/-release-unsigned//")
mv $f $RENAMED_FILENAME
sha256sum $RENAMED_FILENAME
done && \
echo -e "\n" ';
42 changes: 42 additions & 0 deletions fetch_libraries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
VERSION=v0.18.0-beta-blixt

ANDROID_FILE=Lndmobile.aar

ANDROID_SHA256='c0f8e77da00795a370ef2a1c5ba9d413707c52226c33c2ef1e272007c2f30149'

FILE_PATH=https://github.com/hsjoberg/lnd/releases/download/$VERSION/

ANDROID_LINK=$FILE_PATH$ANDROID_FILE

# test that curl and unzip are installed
if ! command -v curl &> /dev/null
then
echo "curl could not be found. Please install it and run the script again."
exit
fi

if ! command -v unzip &> /dev/null
then
echo "unzip could not be found. Please install it and run the script again."
exit
fi

###########
# Android #
###########

if ! echo "$ANDROID_SHA256 android/lndmobile/$ANDROID_FILE" | sha256sum -c -; then
echo "Android library file missing or checksum failed" >&2

# delete old instance of library file
rm android/lndmobile/$ANDROID_FILE

# download Android LND library file
curl -L $ANDROID_LINK > android/lndmobile/$ANDROID_FILE

# check checksum
if ! echo "$ANDROID_SHA256 android/lndmobile/$ANDROID_FILE" | sha256sum -c -; then
echo "Android checksum failed" >&2
exit 1
fi
fi
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"gen-proto": "pbjs -t static-module -w es6 --force-long -o proto/lightning.js proto/*.proto proto/*/*.proto && pbts -o proto/lightning.d.ts proto/lightning.js",
"build-tor-lib": "./build-tor",
"prepare-release": "yarn install && cd ios && pod install && cd ../macos && pod install",
"android:build": "yarn install && ./build/fetch_libraries.sh && cd android && ./gradlew assembleChainmainnetNormalRelease",
"android:build": "yarn install && ./fetch_libraries.sh && cd android && ./gradlew assembleChainmainnetNormalRelease",
"android:clean": "cd android && ./gradlew clean",
"android:regtest-debug": "react-native run-android --mode chainregtestNormalDebug --appIdSuffix regtest.debug --main-activity MainActivity",
"android:regtest": "react-native run-android --mode chainregtestNormalRelease --appIdSuffix regtest",
Expand Down

0 comments on commit 4fd76b9

Please sign in to comment.