Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update apk generation and naming convention #2293

Merged
merged 10 commits into from
Jul 12, 2019
42 changes: 33 additions & 9 deletions exec/apk-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ then
else
/bin/rm -f app-fdroid-debug.apk app-playStore-debug.apk app-playStore-release.apk app-fdroid-release.apk
fi
\cp -r ../app/build/outputs/apk/fdroid/*/**.apk .
\cp -r ../app/build/outputs/apk/playStore/*/**.apk .
\cp -r ../app/build/outputs/apk/fdroid/debug/output.json fdroidDebug-output.json
\cp -r ../app/build/outputs/apk/fdroid/release/output.json fdroidRelease-output.json
\cp -r ../app/build/outputs/apk/playStore/debug/output.json playStoreDebug-output.json
\cp -r ../app/build/outputs/apk/playStore/release/output.json playStoreRelease-output.json

find ../app/build/outputs -type f -name '*.apk' -exec cp -v {} . \;
find ../app/build/outputs -type f -name '*.aab' -exec cp -v {} . \;

# Signing App
if [ "$CIRCLE_BRANCH" == "$PUBLISH_BRANCH" ]; then
Expand All @@ -33,10 +30,37 @@ then

if [ "$CIRCLE_BRANCH" == "$PUBLISH_BRANCH" ]; then
for file in app*; do
cp $file susi-ai-master-${file%%}
cp $file susiai-master-${file%%}
done
fi
# Create a new branch that will contain only latest apk

# Remove app- from the name of the files
for file in *.apk;do
if [[ "$file" == *"app-"* ]];then
mv "${file}" "${file//app-/}"
fi
done

# Remove playStore- from the name of the files
for file in *.apk;do
if [[ "$file" == *"playStore"* ]];then
mv "${file}" "${file//playStore-/}"
fi
done

# Append susiai-dev to the non master branch apk's
for file in *.apk;do
if [[ "$file" != *"master"* ]];then
mv $file susiai-dev-${file%%}
fi
done

# Remove unwanted apk files
rm susiai-dev-fdroid-release-unsigned.apk
rm susiai-dev-release-unaligned.apk
rm susiai-master-release-unaligned.apk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still haven't seen other scripts


# Create a new branch that will contain only latest apk
git checkout --orphan workaround

# Add generated APK
Expand All @@ -57,6 +81,6 @@ then
if [ "$CIRCLE_BRANCH" == "$PUBLISH_BRANCH" ]; then
echo "Publishing app to Play Store"
gem install fastlane
fastlane supply --apk app-playStore-release.apk --track alpha --json_key ../exec/fastlane.json --package_name $PACKAGE_NAME
fastlane supply --aab susiai-master-release.aab --track alpha --json_key ../exec/fastlane.json --package_name $PACKAGE_NAME
fi
fi