-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
27 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,29 +27,6 @@ jobs: | |
with: | ||
fetch-depth: 1 | ||
|
||
- name: expose version from build.gradle | ||
if: matrix.build == 'lite' | ||
uses: dogi/[email protected] | ||
with: | ||
expose-version-name: 'true' | ||
|
||
- name: diff the code to get lite | ||
if: matrix.build == 'lite' | ||
run: | | ||
echo "ANDROID_VERSION_NAME_ORIG=${ANDROID_VERSION_NAME}" >> $GITHUB_ENV | ||
ls -al app/build.gradle | ||
sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle | ||
echo "${{ env.FILES }}" | xargs -n 1 | while read file; do | ||
ls -al $file* | ||
cp "${file}.lite" "$file" | ||
done | ||
- name: expose version from build.gradle | ||
uses: dogi/[email protected] | ||
with: | ||
expose-version-name: 'true' | ||
expose-version-code: 'true' | ||
|
||
- name: setup JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
|
@@ -64,8 +41,21 @@ jobs: | |
cache-read-only: false | ||
cache-write-only: false | ||
|
||
- name: diff the code to get lite | ||
if: matrix.build == 'lite' | ||
run: | | ||
echo "${{ env.FILES }}" | xargs -n 1 | while read file; do | ||
ls -al $file* | ||
cp "${file}.lite" "$file" | ||
done | ||
ls -al app/build.gradle | ||
echo ANDROID_VERSION_LITE=$(grep -oP 'versionName "\K[^\"]+' app/build.gradle) >> $GITHUB_ENV | ||
sed -i 's/\(versionName "[0-9.]\+\)"/\1-lite"/' app/build.gradle | ||
- name: build release APK and AAB | ||
run: | | ||
echo ANDROID_VERSION_NAME=$(grep -oP 'versionName "\K[^\"]+' app/build.gradle) >> $GITHUB_ENV | ||
echo ANDROID_VERSION_CODE=$(grep versionCode app/build.gradle | sed 's/[^0-9]//g') >> $GITHUB_ENV | ||
./gradlew assembleRelease bundleRelease | ||
ls -alR app/build/outputs | ||
mkdir -p sign | ||
|
@@ -118,12 +108,12 @@ jobs: | |
- name: rename APK and AAB with version and branch for artifact | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
mv output/myPlanet.apk output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.apk | ||
mv output/myPlanet.apk.sha256 output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.apk.sha256 | ||
mv output/myPlanet.aab output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.aab | ||
mv output/myPlanet.aab.sha256 output/myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }}.aab.sha256 | ||
ls -alR output | ||
echo "BRANCHNAME=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
- name: upload APK and AAB as build artifact | ||
if: github.event_name == 'workflow_dispatch' | ||
|
@@ -140,7 +130,7 @@ jobs: | |
mv output/myPlanet.apk.sha256 output/myPlanet-lite.apk.sha256 | ||
mv output/myPlanet.aab output/myPlanet-lite.aab | ||
mv output/myPlanet.aab.sha256 output/myPlanet-lite.aab.sha256 | ||
echo "ANDROID_VERSION_NAME=${ANDROID_VERSION_NAME_ORIG}" >> $GITHUB_ENV | ||
echo "ANDROID_VERSION_NAME=${ANDROID_VERSION_LITE}" >> $GITHUB_ENV | ||
- name: release APK and AAB on GitHub | ||
if: github.event_name != 'workflow_dispatch' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters