mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-08 19:46:10 +01:00
Automatically attach debug APKs when a release is created
This commit is contained in:
parent
f10de462d2
commit
00d80b9e02
3 changed files with 58 additions and 12 deletions
36
.github/workflows/attach_debug_apks_to_release.yml
vendored
Normal file
36
.github/workflows/attach_debug_apks_to_release.yml
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
name: Attach Debug APKs To Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: Set tag
|
||||||
|
id: vars
|
||||||
|
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
|
||||||
|
- name: Clone repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ env.GITHUB_REF }}
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ steps.vars.outputs.tag }}
|
||||||
|
run: ./gradlew assembleDebug
|
||||||
|
- name: Attach debug APKs to release
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ steps.vars.outputs.tag }}
|
||||||
|
run: >-
|
||||||
|
hub release edit
|
||||||
|
-m ""
|
||||||
|
-a ./app/build/outputs/apk/debug/termux-app-universal-$RELEASE_TAG-debug.apk
|
||||||
|
-a ./app/build/outputs/apk/debug/termux-app-arm64-v8a-$RELEASE_TAG-debug.apk
|
||||||
|
-a ./app/build/outputs/apk/debug/termux-app-armeabi-v7a-$RELEASE_TAG-debug.apk
|
||||||
|
-a ./app/build/outputs/apk/debug/termux-app-x86_64-$RELEASE_TAG-debug.apk
|
||||||
|
-a ./app/build/outputs/apk/debug/termux-app-x86-$RELEASE_TAG-debug.apk
|
||||||
|
$RELEASE_TAG
|
||||||
10
.github/workflows/debug_build.yml
vendored
10
.github/workflows/debug_build.yml
vendored
|
|
@ -24,33 +24,33 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: termux-app-universal
|
name: termux-app-universal
|
||||||
path: |
|
path: |
|
||||||
./app/build/outputs/apk/debug/app-universal-debug.apk
|
./app/build/outputs/apk/debug/termux-app-universal-debug.apk
|
||||||
./app/build/outputs/apk/debug/output-metadata.json
|
./app/build/outputs/apk/debug/output-metadata.json
|
||||||
- name: Store generated arm64-v8a APK file
|
- name: Store generated arm64-v8a APK file
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: termux-app-arm64-v8a
|
name: termux-app-arm64-v8a
|
||||||
path: |
|
path: |
|
||||||
./app/build/outputs/apk/debug/app-arm64-v8a-debug.apk
|
./app/build/outputs/apk/debug/termux-app-arm64-v8a-debug.apk
|
||||||
./app/build/outputs/apk/debug/output-metadata.json
|
./app/build/outputs/apk/debug/output-metadata.json
|
||||||
- name: Store generated armeabi-v7a APK file
|
- name: Store generated armeabi-v7a APK file
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: termux-app-armeabi-v7a
|
name: termux-app-armeabi-v7a
|
||||||
path: |
|
path: |
|
||||||
./app/build/outputs/apk/debug/app-armeabi-v7a-debug.apk
|
./app/build/outputs/apk/debug/termux-app-armeabi-v7a-debug.apk
|
||||||
./app/build/outputs/apk/debug/output-metadata.json
|
./app/build/outputs/apk/debug/output-metadata.json
|
||||||
- name: Store generated x86_64 APK file
|
- name: Store generated x86_64 APK file
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: termux-app-x86_64
|
name: termux-app-x86_64
|
||||||
path: |
|
path: |
|
||||||
./app/build/outputs/apk/debug/app-x86_64-debug.apk
|
./app/build/outputs/apk/debug/termux-app-x86_64-debug.apk
|
||||||
./app/build/outputs/apk/debug/output-metadata.json
|
./app/build/outputs/apk/debug/output-metadata.json
|
||||||
- name: Store generated x86 APK file
|
- name: Store generated x86 APK file
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: termux-app-x86
|
name: termux-app-x86
|
||||||
path: |
|
path: |
|
||||||
./app/build/outputs/apk/debug/app-x86-debug.apk
|
./app/build/outputs/apk/debug/termux-app-x86-debug.apk
|
||||||
./app/build/outputs/apk/debug/output-metadata.json
|
./app/build/outputs/apk/debug/output-metadata.json
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
plugins {
|
plugins {
|
||||||
id "com.android.application"
|
id "com.android.application"
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|
@ -102,6 +102,16 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
applicationVariants.all { variant ->
|
||||||
|
variant.outputs.all { output ->
|
||||||
|
if (variant.buildType.name == "debug") {
|
||||||
|
def abi = output.getFilter(com.android.build.OutputFile.ABI)
|
||||||
|
def releaseTag = System.getenv("RELEASE_TAG")
|
||||||
|
outputFileName = new File("termux-app-" + (abi ? abi : "universal") + (releaseTag ? "-" + releaseTag : "") + "-debug.apk")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
@ -110,9 +120,9 @@ dependencies {
|
||||||
}
|
}
|
||||||
|
|
||||||
task versionName {
|
task versionName {
|
||||||
doLast {
|
doLast {
|
||||||
print android.defaultConfig.versionName
|
print android.defaultConfig.versionName
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def downloadBootstrap(String arch, String expectedChecksum, String version) {
|
def downloadBootstrap(String arch, String expectedChecksum, String version) {
|
||||||
|
|
@ -175,7 +185,7 @@ task downloadBootstraps() {
|
||||||
}
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
variant.javaCompileProvider.get().dependsOn(downloadBootstraps)
|
variant.javaCompileProvider.get().dependsOn(downloadBootstraps)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue