OPS: Updated filename for APK

This commit is contained in:
Marcos Rodriguez Velez 2024-02-03 20:23:00 -04:00
parent 01fe2dbc37
commit 9e963e4436
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7
2 changed files with 14 additions and 9 deletions

View file

@ -40,14 +40,21 @@ jobs:
- name: Install node_modules
run: npm install --production
- name: Generate Build Number based on timestamp
run: |
NEW_BUILD_NUMBER=$(date +%s)
echo "NEW_BUILD_NUMBER=$NEW_BUILD_NUMBER" >> $GITHUB_ENV
echo "::set-output name=build_number::$NEW_BUILD_NUMBER"
- name: Build
env:
KEYSTORE_FILE_HEX: ${{ secrets.KEYSTORE_FILE_HEX }}
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
BUILD_NUMBER: ${{ env.NEW_BUILD_NUMBER }}
run: ./scripts/build-release-apk.sh
- uses: actions/upload-artifact@v2
if: success()
with:
name: apk
path: ./android/app/build/outputs/apk/release/app-release.apk
path: ./android/app/build/outputs/apk/release/BlueWallet-6.5.0(${{ env.NEW_BUILD_NUMBER }}).apk

View file

@ -1,23 +1,21 @@
#!/bin/bash
# assumes 2 env variables: KEYSTORE_FILE_HEX & KEYSTORE_PASSWORD
#
# PS. to turn file to hex and back:
# $ xxd -plain test.txt > test.hex
# $ xxd -plain -revert test.hex test2.txt
echo $KEYSTORE_FILE_HEX > bluewallet-release-key.keystore.hex
xxd -plain -revert bluewallet-release-key.keystore.hex > ./android/bluewallet-release-key.keystore
rm bluewallet-release-key.keystore.hex
cd android
TIMESTAMP=$(date +%s)
sed -i'.original' "s/versionCode 1/versionCode $TIMESTAMP/g" app/build.gradle
# Use the BUILD_NUMBER environment variable set in the GitHub Actions workflow
sed -i'.original' "s/versionCode 1/versionCode $BUILD_NUMBER/g" app/build.gradle
./gradlew assembleRelease
mv ./app/build/outputs/apk/release/app-release-unsigned.apk ./app/build/outputs/apk/release/app-release.apk
# Rename the APK file to include the version and build number with parentheses
mv ./app/build/outputs/apk/release/app-release-unsigned.apk ./app/build/outputs/apk/release/BlueWallet-6.5.0($BUILD_NUMBER).apk
echo wheres waldo?
find $ANDROID_HOME | grep apksigner | grep -v jar
$ANDROID_HOME/build-tools/34.0.0/apksigner sign --ks ./bluewallet-release-key.keystore --ks-pass=pass:$KEYSTORE_PASSWORD ./app/build/outputs/apk/release/app-release.apk
$ANDROID_HOME/build-tools/34.0.0/apksigner sign --ks ./bluewallet-release-key.keystore --ks-pass=pass:$KEYSTORE_PASSWORD ./app/build/outputs/apk/release/BlueWallet-6.5.0($BUILD_NUMBER).apk