Skip to content

Commit

Permalink
Added: Automatically attach debug APKs when a release is created
Browse files Browse the repository at this point in the history
  • Loading branch information
agnostic-apollo committed Sep 5, 2021
1 parent d0e8805 commit 705361e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/attach_debug_apks_to_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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-tasker-$RELEASE_TAG-debug.apk
$RELEASE_TAG
6 changes: 4 additions & 2 deletions .github/workflows/debug_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
run: |
./gradlew assembleDebug
- name: Store generated APK file
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: termux-tasker
path: ./app/build/outputs/apk/debug/app-debug.apk
path: |
./app/build/outputs/apk/debug/termux-tasker-debug.apk
./app/build/outputs/apk/debug/output-metadata.json
9 changes: 9 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

applicationVariants.all { variant ->
variant.outputs.all { output ->
if (variant.buildType.name == "debug") {
def releaseTag = System.getenv("RELEASE_TAG")
outputFileName = new File("termux-tasker" + (releaseTag ? "-" + releaseTag : "") + "-debug.apk")
}
}
}
}

dependencies {
Expand Down

0 comments on commit 705361e

Please sign in to comment.