Skip to content

Commit

Permalink
workflow + custom github build type
Browse files Browse the repository at this point in the history
  • Loading branch information
MFlisar committed Nov 2, 2023
1 parent c3049bb commit d8611e4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Add apk to release
name: Add APK to latest release

env:

main_project_module: demo
assemble_type: assembleDebug
build_type: debug
# demo-release-unsigned.apk
apk_name_unsigned_apk: demo-debug.apk
assemble_type: assembleGithub
build_type: github
apk_name_unsigned_apk: demo-github.apk

on:
push:
Expand All @@ -22,15 +21,15 @@ on:

jobs:
build:
name: Building apk and adding it to the latest release
name: Building APK and adding it to the latest release
runs-on: ubuntu-latest
steps:

# 1) Checkout
- uses: actions/checkout@v3

# 2) Setup JAVA
- name: set up JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
Expand All @@ -56,7 +55,7 @@ jobs:

# demo-release-unsigned.apk

- name: Upload binaries to release
- name: Upload APK to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 12 additions & 0 deletions demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ android {
versionName = "1.0"
}

// custom build type for github apk (no signing but minified)
buildTypes {
create("github") {
initWith(getByName("debug"))
isMinifyEnabled = true
isShrinkResources = true
applicationIdSuffix = ".github"
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
matchingFallbacks.add("debug")
}
}

// eventually use local custom signing
val debugKeyStore = providers.gradleProperty("debugKeyStore").orNull
if (debugKeyStore != null) {
Expand Down

0 comments on commit d8611e4

Please sign in to comment.