|
44 | 44 | - name: Make gradlew executable |
45 | 45 | run: chmod +x ./gradlew |
46 | 46 |
|
47 | | - - name: Build debug APK |
48 | | - run: ./gradlew :app:assembleDebug --no-daemon --stacktrace |
| 47 | + - name: Build debug APKs |
| 48 | + # Build the phone APK on every branch. Build the wear APK too when |
| 49 | + # the branch has a wear/ module (currently only wear-os-watch-ultra), |
| 50 | + # so testers can grab both halves from the same rolling release. |
| 51 | + run: | |
| 52 | + targets=":app:assembleDebug" |
| 53 | + if [ -f wear/build.gradle.kts ]; then |
| 54 | + targets="$targets :wear:assembleDebug" |
| 55 | + fi |
| 56 | + ./gradlew $targets --no-daemon --stacktrace |
49 | 57 | env: |
50 | 58 | GRADLE_OPTS: -Xmx4g -Dorg.gradle.jvmargs=-Xmx4g |
51 | 59 |
|
|
57 | 65 | SHORT_SHA="$(git rev-parse --short HEAD)" |
58 | 66 | TAG="branch-${BRANCH}" |
59 | 67 | APK_NAME="EUC-Planet-${BRANCH}-${SHORT_SHA}.apk" |
| 68 | + WEAR_APK_NAME="EUC-Planet-${BRANCH}-${SHORT_SHA}-wear.apk" |
60 | 69 |
|
61 | 70 | # Pull the per-branch description if BRANCH.md exists, otherwise |
62 | 71 | # fall back to a generic notice. This becomes the release body header. |
@@ -91,20 +100,34 @@ jobs: |
91 | 100 | echo "short_sha=${SHORT_SHA}" >> "$GITHUB_OUTPUT" |
92 | 101 | echo "tag=${TAG}" >> "$GITHUB_OUTPUT" |
93 | 102 | echo "apk_name=${APK_NAME}" >> "$GITHUB_OUTPUT" |
| 103 | + echo "wear_apk_name=${WEAR_APK_NAME}" >> "$GITHUB_OUTPUT" |
94 | 104 |
|
95 | | - - name: Rename APK for release |
| 105 | + - name: Rename APKs for release |
96 | 106 | if: github.event_name != 'pull_request' |
97 | 107 | run: | |
98 | 108 | cp app/build/outputs/apk/debug/app-debug.apk \ |
99 | 109 | "/tmp/${{ steps.meta.outputs.apk_name }}" |
| 110 | + # Wear APK only exists on branches that have a wear/ module. |
| 111 | + if [ -f wear/build/outputs/apk/debug/wear-debug.apk ]; then |
| 112 | + cp wear/build/outputs/apk/debug/wear-debug.apk \ |
| 113 | + "/tmp/${{ steps.meta.outputs.wear_apk_name }}" |
| 114 | + fi |
100 | 115 |
|
101 | | - - name: Upload APK as workflow artifact |
| 116 | + - name: Upload phone APK as workflow artifact |
102 | 117 | uses: actions/upload-artifact@v4 |
103 | 118 | with: |
104 | 119 | name: app-debug-${{ github.run_id }} |
105 | 120 | path: app/build/outputs/apk/debug/app-debug.apk |
106 | 121 | retention-days: 90 |
107 | 122 |
|
| 123 | + - name: Upload wear APK as workflow artifact |
| 124 | + if: hashFiles('wear/build/outputs/apk/debug/wear-debug.apk') != '' |
| 125 | + uses: actions/upload-artifact@v4 |
| 126 | + with: |
| 127 | + name: wear-debug-${{ github.run_id }} |
| 128 | + path: wear/build/outputs/apk/debug/wear-debug.apk |
| 129 | + retention-days: 90 |
| 130 | + |
108 | 131 | - name: Strip prior APKs from rolling release |
109 | 132 | if: github.event_name != 'pull_request' |
110 | 133 | env: |
@@ -133,6 +156,7 @@ jobs: |
133 | 156 | body_path: /tmp/release-body.md |
134 | 157 | prerelease: true |
135 | 158 | # Replace the existing tag/release on every push so testers can |
136 | | - # always find the latest at the same URL. |
| 159 | + # always find the latest at the same URL. The glob picks up both |
| 160 | + # the phone APK and (if the branch has wear/) the watch APK. |
137 | 161 | make_latest: "false" |
138 | | - files: /tmp/${{ steps.meta.outputs.apk_name }} |
| 162 | + files: /tmp/EUC-Planet-${{ steps.meta.outputs.branch }}-${{ steps.meta.outputs.short_sha }}*.apk |
0 commit comments