-
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.
Merge branch 'master' into 3683-deprecations-in-dashboardactivitykt
- Loading branch information
Showing
38 changed files
with
533 additions
and
456 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 |
---|---|---|
|
@@ -15,31 +15,34 @@ jobs: | |
matrix: | ||
build: [default, lite] | ||
env: | ||
ANDROID_NDK_VERSION: "21.3.6528147" | ||
BUILD_TOOLS_VERSION: "34.0.0" | ||
FILES: | | ||
app/src/main/AndroidManifest.xml | ||
app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt | ||
app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt | ||
app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt | ||
steps: | ||
- name: checkout repository code | ||
uses: actions/checkout@v4 | ||
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 "lite" | ||
ls -al \ | ||
app/build.gradle \ | ||
app/src/main/AndroidManifest.xml \ | ||
app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt \ | ||
app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt \ | ||
app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt | ||
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 | ||
cp app/src/main/AndroidManifest.xml.lite app/src/main/AndroidManifest.xml | ||
cp app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt.lite app/src/main/java/org/ole/planet/myplanet/base/BaseContainerFragment.kt | ||
cp app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt.lite app/src/main/java/org/ole/planet/myplanet/base/PermissionActivity.kt | ||
cp app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt.lite app/src/main/java/org/ole/planet/myplanet/ui/dashboard/DashboardActivity.kt | ||
- name: set more env | ||
run: echo "BRANCHNAME="${GITHUB_REF##*/} >> $GITHUB_ENV | ||
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] | ||
|
@@ -52,21 +55,14 @@ jobs: | |
with: | ||
distribution: 'zulu' | ||
java-version: '17' | ||
cache: 'gradle' | ||
|
||
- name: install NDK | ||
run: | | ||
set -x | ||
echo "ANDROID_HOME is set to: ${ANDROID_HOME}" | ||
echo "ANDROID_SDK_ROOT is set to: ${ANDROID_SDK_ROOT}" | ||
echo "ANDROID_NDK_VERSION is set to: ${ANDROID_NDK_VERSION}" | ||
echo "y" | sudo ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${ANDROID_NDK_VERSION}" --sdk_root=${ANDROID_SDK_ROOT} 2>&1 | ||
if [ $? -ne 0 ]; then | ||
echo "SDK Manager command failed" | ||
exit 1 | ||
fi | ||
set +x | ||
chmod +x ./gradlew | ||
- name: setup gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
with: | ||
gradle-version: 8.7 | ||
cache-disabled: false | ||
cache-read-only: false | ||
cache-write-only: false | ||
|
||
- name: build release APK and AAB | ||
run: | | ||
|
@@ -77,7 +73,7 @@ jobs: | |
cp app/build/outputs/apk/release/app-release-unsigned.apk sign/. | ||
- name: sign release APK and AAB | ||
uses: dogi/sign-android-release@v5 | ||
uses: dogi/sign-android-release@v5.1 | ||
with: | ||
releaseDirectory: sign | ||
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | ||
|
@@ -95,8 +91,10 @@ jobs: | |
ls -alR output | ||
- name: publish AAB to playstore | ||
if: (github.ref == 'refs/heads/master') && (matrix.build == 'lite') | ||
uses: dogi/[email protected] | ||
id: playstore | ||
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' | ||
continue-on-error: true | ||
uses: dogi/[email protected] | ||
with: | ||
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | ||
packageName: org.ole.planet.myplanet | ||
|
@@ -105,26 +103,48 @@ jobs: | |
releaseName: "${{ env.ANDROID_VERSION_CODE }} (${{ env.ANDROID_VERSION_NAME }})" | ||
status: completed | ||
|
||
- name: publish AAB to playstore fallback | ||
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' && steps.playstore.outcome == 'failure' | ||
uses: dogi/[email protected] | ||
with: | ||
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | ||
packageName: org.ole.planet.myplanet | ||
releaseFiles: output/myPlanet.aab | ||
track: internal | ||
releaseName: "${{ env.ANDROID_VERSION_CODE }} (${{ env.ANDROID_VERSION_NAME }})" | ||
status: completed | ||
changesNotSentForReview: true | ||
|
||
- name: rename APK and AAB with version and branch for artifact | ||
if: github.ref != 'refs/heads/master' | ||
if: github.event_name == 'workflow_dispatch' | ||
run: | | ||
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.ref != 'refs/heads/master' | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: myPlanet-${{ env.ANDROID_VERSION_NAME }}-${{ env.BRANCHNAME }} | ||
path: output/* | ||
retention-days: 9 | ||
|
||
- name: pre-process files and tag for lite version | ||
if: github.event_name != 'workflow_dispatch' && matrix.build == 'lite' | ||
run: | | ||
mv output/myPlanet.apk output/myPlanet-lite.apk | ||
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 | ||
- name: release APK and AAB on GitHub | ||
if: github.ref == 'refs/heads/master' | ||
uses: dogi/upload-release-action@v2.7.1 | ||
if: github.event_name != 'workflow_dispatch' | ||
uses: dogi/upload-release-action@v2.9.0 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: output/* | ||
|
@@ -133,7 +153,7 @@ jobs: | |
file_glob: 'true' | ||
|
||
- name: send success message to discord | ||
if: (github.ref == 'refs/heads/master') && (matrix.build != 'lite') | ||
if: github.event_name != 'workflow_dispatch' && matrix.build != 'lite' | ||
run: | | ||
sudo npm install -g @treehouses/cli | ||
export discord_channel="${{ secrets.CHANNEL }}" #remote | ||
|
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
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
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
Oops, something went wrong.