From 1b00cfc3726caeffb0dd566cfb745d3fa429d88b Mon Sep 17 00:00:00 2001 From: zeppi Date: Tue, 22 Nov 2022 12:23:28 -0500 Subject: [PATCH] new build system, 111 full build wip troubleshoot fix env vars fix? fix??? unterminated quoted string.. troubleshoot aws upload test? --- .github/workflows/deploy.yml | 147 +++++++++++++++++++++++++++++++++++ .gitignore | 1 + BUILD.md | 14 ++++ signing2.pgp | Bin 0 -> 4932 bytes src/main/python/main.py | 2 +- 5 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 signing2.pgp diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8b13789..a46770b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1 +1,148 @@ +name: Publish Assets +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build_arm64_aar: + runs-on: ubuntu-latest + container: lbry/android-base:python39 + steps: + - name: checkout + uses: actions/checkout@v3 + - name: hacky copy # docker image runs ~ as /root, but github actions uses ~=/github/home + run: | + cp -r /root/.buildozer ~/.buildozer/ + - name: setup + run: | + export B_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') + echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV + echo "BUILD_VERSION=${B_VERSION}" >> $GITHUB_ENV + export PATH=/usr/bin:$PATH + wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/ + tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/ + rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9 + ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9 + cp -f $GITHUB_WORKSPACE/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh + cp -f $GITHUB_WORKSPACE/scripts/mangled-glibc-syscalls__arm64.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm64/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h + cp -f $GITHUB_WORKSPACE/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk + rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite + cp -Rf $GITHUB_WORKSPACE/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite + rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz + mv buildozer.spec.arm64.ci buildozer.spec + chmod u+x ./build-release.sh + - name: build release + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} + NEXUS_SIGNING_KEY_PASSWORD: ${{ secrets.NEXUS_SIGNING_KEY_PASSWORD }} + NEXUS_SIGNING_KEY_ID: ${{ secrets.NEXUS_SIGNING_KEY_ID }} + run: ./build-release.sh + - name: debug bin + run : ls -al ./bin + - name: upload to build_lbry_io + run : | + pip install awscli + export PR_NUMBER=${{ github.event.number }} + + export BUILD_APK_FILENAME__64=lbrysdk-${{ env.BUILD_VERSION }}-arm64-v8a-release.aar + aws s3 cp ./bin/${BUILD_APK_FILENAME__64} s3://build.lbry.io/android/sdk-build-${PR_NUMBER}_commit-${{ github.sha }}/${BUILD_APK_FILENAME__64} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + - name: github release + if: startsWith(github.ref, 'refs/tags/v') + run: | + pip install githubrelease + export GITHUB_TOKEN=${{ github.token }} + githubrelease release lbryio/lbry-android-sdk create ${{ github.ref_name }} --publish bin/${BUILD_APK_FILENAME__64} + + build_arm_aar: + runs-on: ubuntu-latest + container: lbry/android-base:python39 + needs: [build_arm64_aar] + steps: + - name: checkout + uses: actions/checkout@v3 + - name: hacky copy # docker image runs ~ as /root, but github actions uses ~=/github/home + run: | + cp -r /root/.buildozer ~/.buildozer/ + - name: setup + run: | + export B_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') + echo "BUILD_VERSION=${B_VERSION}" >> $GITHUB_ENV + echo "NEXUS_SIGNING_KEYRING_FILE=$GITHUB_WORKSPACE/signing2.pgp" >> $GITHUB_ENV + export PATH=/usr/bin:$PATH + wget -q 'https://eu.crystax.net/download/crystax-ndk-10.3.2-linux-x86_64.tar.xz' -P ~/.buildozer/android/ + tar -xf ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz -C ~/.buildozer/android/ + rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9 + ln -s ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21 ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-9 + cp -f $GITHUB_WORKSPACE/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle.arm $GITHUB_WORKSPACE/p4a/pythonforandroid/bootstraps/lbry/build/templates/build.tmpl.gradle + cp -f $GITHUB_WORKSPACE/scripts/build-target-python.sh ~/.buildozer/android/crystax-ndk-10.3.2/build/tools/build-target-python.sh + cp -f $GITHUB_WORKSPACE/scripts/mangled-glibc-syscalls.h ~/.buildozer/android/crystax-ndk-10.3.2/platforms/android-21/arch-arm/usr/include/crystax/bionic/libc/include/sys/mangled-glibc-syscalls.h + cp -f $GITHUB_WORKSPACE/scripts/build-binary.mk ~/.buildozer/android/crystax-ndk-10.3.2/build/core/build-binary.mk + rm -rf ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite + cp -Rf $GITHUB_WORKSPACE/scripts/crystax-sources/sqlite ~/.buildozer/android/crystax-ndk-10.3.2/sources/sqlite + rm ~/.buildozer/android/crystax-ndk-10.3.2-linux-x86_64.tar.xz + mv buildozer.spec.arm64.ci buildozer.spec + chmod u+x ./build-release.sh + - name: build release + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} + NEXUS_SIGNING_KEY_PASSWORD: ${{ secrets.NEXUS_SIGNING_KEY_PASSWORD }} + NEXUS_SIGNING_KEY_ID: ${{ secrets.NEXUS_SIGNING_KEY_ID }} + run: ./build-release.sh + - name: upload to build_lbry_io + run : | + pip install awscli + export PR_NUMBER=${{ github.event.number }} + export BUILD_APK_FILENAME__32=lbrysdk-${{ env.BUILD_VERSION }}-armeabi-v7a-release.aar + aws s3 cp bin/${BUILD_APK_FILENAME__32} s3://build.lbry.io/android/sdk-build-{$PR_NUMBER}_commit-${{ github.sha }}/${BUILD_APK_FILENAME__32} + env: + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} + - name: github upload binary + if: startsWith(github.ref, 'refs/tags/v') + uses: skx/github-action-publish-binaries@release-1.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BUILD_VERSION: ${{ env.BUILD_VERSION }} + with: + args: bin/${BUILD_APK_FILENAME__32} + # deploy_build_lbry_io: + # runs-on: ubuntu-latest + # container: lbry/android-base:python39 + # needs: [build_arm64_aar, build_arm_aar] + # steps: + # - name: dependencies + # run: | + # pip install awscli + # export PR_NUMBER=${{ github.event.number }} + # export BUILD_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') + # export BUILD_APK_FILENAME__32=lbrysdk-${{ BUILD_VERSION }}-armeabi-v7a-release.aar + # export BUILD_APK_FILENAME__64=lbrysdk-${{ BUILD_VERSION }}-arm64-v8a-release.aar + # - name: upload + # run: | + # aws s3 cp bin/${{ BUILD_APK_FILENAME__64 }} s3://build.lbry.io/android/sdk-build-${{ PR_NUMBER }}_commit-${{ github.sha }}/${{ BUILD_APK_FILENAME__64 }} + # aws s3 cp bin/${{ BUILD_APK_FILENAME__32 }} s3://build.lbry.io/android/sdk-build-${{ PR_NUMBER }}_commit-${{ github.sha }}/${{ BUILD_APK_FILENAME__32 }} + + # release_aar: + # runs-on: ubuntu-latest + # container: python:latest + # needs: [build_arm64_aar, build_arm_aar] + # steps: + # - name: dependencies + # run: | + # pip install awscli githubrelease + # export BUILD_VERSION=$(cat $GITHUB_WORKSPACE/src/main/python/main.py | grep --color=never -oP '([0-9]+\.?)+') + # export BUILD_APK_FILENAME__32=lbrysdk-${{ BUILD_VERSION }}-armeabi-v7a-release.aar + # export BUILD_APK_FILENAME__64=lbrysdk-${{ BUILD_VERSION }}-arm64-v8a-release.aar + # - name: release diff --git a/.gitignore b/.gitignore index 96477a2..b39ffe8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ src/main/assets/index.android.bundle src/main/assets/index.android.bundle.meta *.log .vagrant +.vscode lbry-android.keystore p4a/pythonforandroid/bootstraps/lbry/build/templates/google-services.json diff --git a/BUILD.md b/BUILD.md index 5de63cf..5da6575 100644 --- a/BUILD.md +++ b/BUILD.md @@ -135,3 +135,17 @@ If you already installed `Android SDK` and `adb` Note: You need to have your device connected with USB debugging. Once the bundler is ready, run the LBRY Browser app on your device and then shake the device violently until you see the React Native dev menu. You can enable "Live Reloading" and "Hot Reloading" from this menu, so any changes you make to the React Native code will be visible as you save. This will only reload React Native Javascript files. Native Java code needs to be redeployed by running the command `./deploy.sh` + +## Update LBRY SDK Version + +### Update the `requirements` section following files +* buildozer.spec.arm.ci +* buildozer.spec.arm64.ci +* buildozer.spec.sample +* buildozer.spec.vagrant + +### Update LBRY_SDK_VERSION in `src/main/java/io/lbry/lbrysdk/LbrynetService.java` + +### Update the version in `src/main/python/main.py` + +## Github Actions CI \ No newline at end of file diff --git a/signing2.pgp b/signing2.pgp new file mode 100644 index 0000000000000000000000000000000000000000..da549e4bf7093d30a2bfb1f3dc337e4e51d02f9a GIT binary patch literal 4932 zcmajhbvzsZ!2fYhcTIOr42L;2-OV;NJ)G%oH;mJ#jni$qIo-{4O`O4kZlS-0DQM1qnOVh75%Uo{dkK>QfUzFnWJdUTxTGhckN|K zQ}(xB3?;F)y3?=2<*vA=w-{=lS?nO4PxF_&b{{d+k0s5NBIvIB@-k@z;Ap3E#99eo^mN zp9AU-idSC3Efdi_2j5<*tG`fk`*-4t?i*$};ILJMjl5DrwBUv2lgdW@sY~JF%H%Uh z`4n0B1WocrqT5#Uj(TBJBiWQj-`iJC96LK>M=vl1JS%8k>GkRcRxUHH$3k$yV;pYR zUVe8Khh9I5hbrW$QAkixP@l2T02+{Gtf`0NsZq z7XHFA_*hexX=*rEYb)0hV2rjDEIB!?!3otOG;&XvnA<(Drhdr@>)k>f1BUA-a*NI1 z1u3CURv*$A6oxt{>k7Phd}(HHNL}35#*;yLEF!sU&}nS121_qyY;Bsa*~#OF!;U4i z;*Z7-hC5heG3|q~y5w7MuIjBO-cX-HT%*N2FYou%8^&-Vcr?*;GHCeIxEe4HseC_* zmrd;#f~zlx$*4_qZ|FkSW*Z8--gq}0p@-{A6Nk{`hp7b1|8nI^zw<9GGt59ej8{8z z;F8PS*S<*uwwe=WnP#ZnS3!4{R}|dz9ev_(E%iUHS)B$E5tAo;&uxBG<_ISDg{FO+ zRP(J&^TzMhdP5t19~%hCvU@4tHV@gQP)&}&FykGw^uSXbBg`f3-Cf~b-m@5c8{78G z$ig^fylS6gS{Dx-P>rjVMr~be)U+cvo>dP8^Sx`mMnH|VlgF5ZlR(Vq#une0L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klk zzC)3_Y%f-x=sEIG+2Uc&*X4H^0UeeD^-tpfxd@KJqCn2$amwF?fPC9M`1jAi^lh(( zc^jIp?A9dpm3vrH4~7acJDwrDQ4ZWGmaadXe60D&V^4tL?s zpln!o;8IwcEy8N(SM~h~;WWxEO8@2&=0J(&+T>=FYcIsm01Gw%Clo*s+lEnTXn*D2 zC&3|h5HT^e&>91KPG2m29)cm0Kk%NB_|KReHW~yL`tS}lw9M3y=~rB=KqL3X>Ss?g sBEzscc|}7mjDnsx_~!G+@G_J_z;wd;)vCKYT2m!`>@pv>!0c%M0k<1&qW}N^ literal 0 HcmV?d00001 diff --git a/src/main/python/main.py b/src/main/python/main.py index eb853da..7b8d814 100644 --- a/src/main/python/main.py +++ b/src/main/python/main.py @@ -1,5 +1,5 @@ # going forward, this should match sdk version -__version__ = "0.102.0" +__version__ = "0.111.0" class ServiceApp(App): def build(self):