Skip to content

Commit

Permalink
reproducible builds
Browse files Browse the repository at this point in the history
  • Loading branch information
nitesh authored and hsjoberg committed Jun 10, 2024
1 parent 22b3464 commit 46397e8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Android
on:
push:
branches:
- reproducible-builds-2

jobs:
build-android:
runs-on: ubuntu-latest
container: reactnativecommunity/react-native-android@sha256:4ff9c9f80da57c72284900fcfdbd079183e735684c62d7fafd3df50fdb895453
steps:
- uses: actions/checkout@v4
- name: Envinfo
run: npx envinfo
- name: Install dependencies
run: |
apt-get update
apt-get install -y curl unzip
- name: Build application
run: yarn build-unsigned-android
- name: Find APK path
run: |
apk_path=$(find . -type f -name "*.apk" | head -n 1)
echo "APK_PATH=$apk_path" >> $GITHUB_ENV
- name: Upload APK as artifact
uses: actions/upload-artifact@v4
with:
name: app-release-unsigned
path: ${{ env.APK_PATH }}
Empty file added android/app/lndmobile/.gitkeep
Empty file.
25 changes: 25 additions & 0 deletions fetch_libraries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
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

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

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

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

# check checksum
if ! echo "$ANDROID_SHA256 android/app/lndmobile/$ANDROID_FILE" | sha256sum -c -; then
echo "Android checksum failed" >&2
exit 1
fi
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"test-update-snapshot": "jest --silent --roots tests --updateSnapshot",
"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",
"build-unsigned-android": "chmod +x fetch_libraries.sh && ./fetch_libraries.sh && yarn && yarn gen-proto && yarn android:mainnet-unsigned",
"prepare-release": "yarn install && cd ios && pod install && cd ../macos && pod install",
"android:clean": "cd android && ./gradlew clean",
"android:regtest-debug": "react-native run-android --mode chainregtestNormalDebug --appIdSuffix regtest.debug --main-activity MainActivity",
Expand All @@ -28,6 +29,7 @@
"android:bundle-release-testnet": "cd android && ./gradlew clean && NODE_OPTIONS=--openssl-legacy-provider ./gradlew bundlechaintestnetNormalRelease",
"android:bundle-js-debug": "react-native bundle --platform android --dev true --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle",
"android:bundle-js-release": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle",
"android:mainnet-unsigned": "cd android && ./gradlew assembleChainmainnetNormalRelease",
"ios:regtest-debug": "react-native run-ios --scheme BlixtWalletRegtest --configuration DebugRegtest",
"ios:regtest": "react-native run-ios --scheme BlixtWalletRegtest --configuration ReleaseRegtest",
"ios:testnet-debug": "react-native run-ios --scheme BlixtWalletTestnet --configuration DebugTestnet",
Expand Down

0 comments on commit 46397e8

Please sign in to comment.