Skip to content

Commit 6f55c94

Browse files
committed
Release v2.2.2
1 parent 14f61ba commit 6f55c94

File tree

3 files changed

+126
-3
lines changed

3 files changed

+126
-3
lines changed

.github/workflows/android-ci-generate-apk-aab-upload-3.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Generated APK AAB 3 (Upload - Create Artifact To Github Action)
1+
name: Generated APK AAB 3 Bundle Tool (Upload - Create Artifact To Github Action)
22

33
env:
44
# The name of the main module repository

README.md

+124-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Using Github Workflows
1717
- Automated Build AAB (release)
1818
- Automated Build APK (release and debug)
19+
- Have Bundle Tool
1920
- Download Artifact
2021
- Upload Artifact
2122
- Clear (Articfact naming)
@@ -26,7 +27,7 @@
2627
## Version Release
2728
This Is Latest Release
2829

29-
$version_release = 2.2.1
30+
$version_release = 2.2.2
3031

3132
What's New??
3233

@@ -36,6 +37,8 @@ What's New??
3637
* Update Kotlin Latest Version *
3738
* Update Java Version From 11 to 17 *
3839
* Update Java Action version to 3 *
40+
* Update Android SDK Tools *
41+
* Add Bundletool.jar for workflow github action *
3942

4043
## Article Sources
4144
- [How To Securely Build and Sign Your Android App With GitHub Actions](https://proandroiddev.com/how-to-securely-build-and-sign-your-android-app-with-github-actions-ad5323452ce)
@@ -194,6 +197,126 @@ jobs:
194197
# skip-recent: 5
195198
```
196199

200+
### Using Bundle Tool
201+
202+
#### Step 1. Prepare Bundle Tool
203+
- Check Bundletool on (.github/lib/bundletool.jar) [Download Latest](https://github.com/google/bundletool/releases)
204+
205+
#### Step 2. Code Action in file [android-ci-generate-apk-aab-upload-3.yml](https://github.com/amirisback/automated-build-android-app-with-github-action/blob/master/.github/workflows/android-ci-generate-apk-aab-upload-3.yml)
206+
207+
```yml
208+
name: Generated APK AAB 3 Bundle Tool (Upload - Create Artifact To Github Action)
209+
210+
env:
211+
# The name of the main module repository
212+
main_project_module: app
213+
214+
# The name of the Play Store
215+
playstore_name: Frogobox ID
216+
217+
# Apk / Aab Name
218+
artifact_name: github-action-automated
219+
220+
# Keystore
221+
ks_path: frogoboxdev.jks
222+
223+
# Keystore Password
224+
ks_store_pass: cronoclez
225+
226+
# Keystore Alias
227+
ks_alias: frogobox
228+
229+
# Keystore Alias Password
230+
ks_alias_pass: xeonranger
231+
232+
on:
233+
234+
push:
235+
branches:
236+
- 'release/**'
237+
238+
# Allows you to run this workflow manually from the Actions tab
239+
workflow_dispatch:
240+
241+
jobs:
242+
build:
243+
244+
runs-on: ubuntu-latest
245+
246+
steps:
247+
- uses: actions/checkout@v3
248+
249+
# Set Current Date As Env Variable
250+
- name: Set current date as env variable
251+
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
252+
253+
# Set Repository Name As Env Variable
254+
- name: Set repository name as env variable
255+
run: echo "repository_name=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> $GITHUB_ENV
256+
257+
- name: Set Up JDK
258+
uses: actions/setup-java@v3
259+
with:
260+
distribution: 'zulu' # See 'Supported distributions' for available options
261+
java-version: '17'
262+
cache: 'gradle'
263+
264+
- name: Change wrapper permissions
265+
run: chmod +x ./gradlew
266+
267+
# Run Tests Build
268+
- name: Run gradle tests
269+
run: ./gradlew test
270+
271+
# Run Build Project
272+
- name: Build gradle project
273+
run: ./gradlew build
274+
275+
# Create APK Debug
276+
- name: Build apk debug project (APK) - ${{ env.main_project_module }} module
277+
run: ./gradlew assembleDebug
278+
279+
# Create APK Release
280+
- name: Build apk release project (APK) - ${{ env.main_project_module }} module
281+
run: ./gradlew assemble
282+
283+
# Create Bundle AAB Release
284+
# Noted for main module build [main_project_module]:bundleRelease
285+
- name: Build app bundle release (AAB) - ${{ env.main_project_module }} module
286+
run: ./gradlew ${{ env.main_project_module }}:bundleRelease
287+
288+
#
289+
# - name: Build APK(s) Debug from bundle using bundletool
290+
# run: java -jar ".github/lib/bundletool.jar" build-apks --bundle=${{ env.main_project_module }}/build/outputs/bundle/debug/${{ env.artifact_name }}-debug.aab --output=${{ env.main_project_module }}/build/outputs/bundle/debug/${{ env.artifact_name }}-debug.apks --mode=universal
291+
292+
# Build APK From Bundle Using Bundletool
293+
# Noted For Output [main_project_module]/build/outputs/bundle/release/
294+
- name: Build APK(s) Release from bundle using bundletool (Path same with bundle output)
295+
run: java -jar ".github/lib/bundletool.jar" build-apks --bundle=${{ env.main_project_module }}/build/outputs/bundle/release/${{ env.artifact_name }}-release.aab --output=${{ env.main_project_module }}/build/outputs/bundle/release/${{ env.artifact_name }}-release.apks --mode=universal --ks="app/${{ env.ks_path }}" --ks-pass=pass:${{ env.ks_store_pass }} --ks-key-alias=${{ env.ks_alias }} --key-pass=pass:${{ env.ks_alias_pass }}
296+
297+
# Upload Artifact Build
298+
# Noted For Output [main_project_module]/build/outputs/apk/debug/
299+
- name: Upload APK Debug - ${{ env.repository_name }}
300+
uses: actions/upload-artifact@v3
301+
with:
302+
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) debug generated
303+
path: ${{ env.main_project_module }}/build/outputs/apk/debug/
304+
305+
# Noted For Output [main_project_module]/build/outputs/apk/release/
306+
- name: Upload APK Release - ${{ env.repository_name }}
307+
uses: actions/upload-artifact@v3
308+
with:
309+
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - APK(s) release generated
310+
path: ${{ env.main_project_module }}/build/outputs/apk/release/
311+
312+
# Noted For Output [main_project_module]/build/outputs/bundle/release/
313+
- name: Upload AAB (App Bundle) Release - ${{ env.repository_name }}
314+
uses: actions/upload-artifact@v3
315+
with:
316+
name: ${{ env.date_today }} - ${{ env.playstore_name }} - ${{ env.repository_name }} - App bundle(s) AAB release generated
317+
path: ${{ env.main_project_module }}/build/outputs/bundle/release/
318+
```
319+
197320
## Colaborator
198321
Very open to anyone, I'll write your name under this, please contribute by sending an email to me
199322

buildSrc/src/main/kotlin/ProjectSetting.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object ProjectSetting {
2424

2525
const val VERSION_MAJOR = 2
2626
const val VERSION_MINOR = 2
27-
const val VERSION_PATCH = 1
27+
const val VERSION_PATCH = 2
2828

2929
const val PROJECT_MIN_SDK = 21
3030
const val PROJECT_COMPILE_SDK = 33

0 commit comments

Comments
 (0)