Skip to content

Commit

Permalink
Don't minify (#6)
Browse files Browse the repository at this point in the history
* Don't minify builds
* Add debug build to release
* Add .free applicationId suffix to not conflict with official app
  • Loading branch information
jaredcat committed Aug 1, 2024
1 parent 000077c commit 5fa90a7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
15 changes: 12 additions & 3 deletions .github/actions/build-android/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ runs:
APP_NAME="${{ github.event.repository.name }}-${GITHUB_SHA}"
echo APP_NAME="$APP_NAME" >> "$GITHUB_ENV"
- name: Build Debug
if: ${{ github.event_name != 'release' }}
uses: ./.github/actions/build-debug
APP_NAME_DEBUG="${{ github.event.repository.name }}-${GITHUB_SHA}-debug"
echo APP_NAME_DEBUG="$APP_NAME_DEBUG" >> "$GITHUB_ENV"
- name: Build Release
if: ${{ github.event_name == 'release' }}
Expand All @@ -74,7 +73,17 @@ runs:
RELEASE_KEY_PASSWORD: ${{ inputs.RELEASE_KEY_PASSWORD }}

- name: Upload Release Build to Artifacts
if: ${{ github.event_name == 'release' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}
path: ${{ env.APK_FILE }}

- name: Build Debug
uses: ./.github/actions/build-debug

- name: Upload Debug Build to Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME_DEBUG }}
path: ${{ env.APK_FILE_DEBUG }}
4 changes: 2 additions & 2 deletions .github/actions/build-debug/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ runs:

- name: Set APK_FILE location
shell: bash
run: echo "APK_FILE=${{ env.BUILD_DIR }}/${{ env.APP_NAME }}.apk" >> "$GITHUB_ENV"
run: echo "APK_FILE_DEBUG=${{ env.BUILD_DIR }}/${{ env.APP_NAME_DEBUG }}.apk" >> "$GITHUB_ENV"

- uses: actions/checkout@v4
- name: Build debug apk
shell: bash
run: |
./gradlew assembleDebug --no-daemon || exit $?
mv ${{ env.BUILD_DIR }}/*.apk "${{ env.APK_FILE }}"
mv ${{ env.BUILD_DIR }}/*.apk "${{ env.APK_FILE_DEBUG }}"
# - name: Build debug bundle
# run: ./gradlew bundleDebug --no-daemon
11 changes: 10 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,16 @@ jobs:
run: echo "name=${{ github.event.release.tag_name || needs.build.outputs.app_version }}" >> $GITHUB_OUTPUT

- uses: actions/download-artifact@v4
- name: Build debug apk

- name: Move debug apk
run: mv **/*-debug.apk ./${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-debug.apk
- uses: termux/[email protected]
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-debug.apk
tag: ${{ steps.tag.outputs.name }}

- name: Move release apk
run: mv **/*.apk ./${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}.apk
- uses: termux/[email protected]
with:
Expand Down
17 changes: 16 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ android {
}
}

buildTypes {
getByName("release") {
applicationIdSuffix = ".free"
isDebuggable=false
isMinifyEnabled = false
isShrinkResources = false
}
getByName("debug") {
applicationIdSuffix = ".free.debug"
isDebuggable = true
isMinifyEnabled = false
isShrinkResources = false
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
Expand Down Expand Up @@ -59,4 +74,4 @@ dependencies {
implementation(libs.bugsnag.android)
implementation(libs.fastcsv)
implementation(libs.relinker)
}
}

0 comments on commit 5fa90a7

Please sign in to comment.