Skip to content

Commit 7762265

Browse files
committed
fixed some issues
1 parent a6adc4d commit 7762265

6 files changed

Lines changed: 676 additions & 361 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,16 @@ jobs:
4040
- name: Grant Execute Permission to Gradle
4141
run: chmod +x gradlew
4242

43-
- name: Build APK
44-
run: ./gradlew assembleGithubRelease --stacktrace
43+
- name: Build APK and Update Lint Baseline
44+
run: ./gradlew assembleGithubRelease assembleFdroidRelease --stacktrace
4545

46-
- name: Find Release APK
47-
run: |
48-
APK_PATH=$(find app/build/outputs/apk/github/release -name '*.apk' -print -quit)
49-
if [[ -z "$APK_PATH" ]]; then
50-
echo "No APK found!"
51-
exit 1
52-
fi
53-
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV
54-
echo "Found APK at: $APK_PATH"
55-
56-
- name: Upload APK as Artifact
46+
- name: Upload APKs as Artifacts
5747
uses: actions/upload-artifact@v4
5848
with:
59-
name: Signed-APK
60-
path: ${{ env.APK_PATH }}
49+
name: Signed-APKs
50+
path: |
51+
app/build/outputs/apk/github/release/*.apk
52+
app/build/outputs/apk/fdroid/release/*.apk
6153
6254
release:
6355
name: Create GitHub Release
@@ -72,23 +64,9 @@ jobs:
7264
- name: Download Signed APK
7365
uses: actions/download-artifact@v4
7466
with:
75-
name: Signed-APK
67+
name: Signed-APKs
7668
path: artifacts/
7769

78-
- name: Find Downloaded APK
79-
run: |
80-
APK_PATH=$(find artifacts -name '*.apk' -print -quit)
81-
if [[ -z "$APK_PATH" ]]; then
82-
echo "No downloaded APK found!"
83-
exit 1
84-
fi
85-
echo "APK_PATH=$APK_PATH" >> $GITHUB_ENV
86-
echo "Downloaded APK at: $APK_PATH"
87-
88-
- name: Rename APK
89-
run: |
90-
mv "${{ env.APK_PATH }}" "aShellYou-${{ github.ref_name }}-release.apk"
91-
9270
- name: Install xmllint
9371
run: sudo apt-get install -y libxml2-utils
9472

@@ -116,7 +94,7 @@ jobs:
11694
- name: Publish Release using gh CLI
11795
run: |
11896
gh release create "${{ github.ref_name }}" \
119-
"aShellYou-${{ github.ref_name }}-release.apk" \
97+
artifacts/*.apk \
12098
--title "aShell You ${{ github.ref_name }}" \
12199
--notes-file changelog.txt
122100
env:

app/build.gradle.kts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,23 @@ android {
125125
}
126126
}
127127

128+
androidComponents {
129+
onVariants { variant ->
130+
if (variant.buildType == "release") {
131+
variant.outputs.forEach { output ->
132+
133+
val flavor = variant.flavorName ?: "noflavor"
134+
val version = android.defaultConfig.versionName ?: "unknown"
135+
136+
@Suppress("UnstableApiUsage")
137+
output.outputFileName.set(
138+
"aShellYou-${version}-${flavor}-release.apk"
139+
)
140+
}
141+
}
142+
}
143+
}
144+
128145
tasks.withType<KotlinCompile>().configureEach {
129146
ksp {
130147
arg("room.schemaLocation", "$projectDir/schemas")

0 commit comments

Comments
 (0)