Skip to content

Commit

Permalink
Merge pull request #92 from LeoAndo/release-v1.0.6
Browse files Browse the repository at this point in the history
Release v1.0.6
  • Loading branch information
LeoAndo authored Feb 25, 2023
2 parents 4634469 + 2bfe3e7 commit 5d34905
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 18 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,62 @@ name: Android CI

on:
push:
branches: [ "main", "develop", /^release\-.*$/ ]
pull_request:
branches: [ "main", "develop", /^release\-.*$/ ]

jobs:
build:

runs-on: ubuntu-latest

timeout-minutes: 60

steps:
# https://github.com/styfle/cancel-workflow-action#usage
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/checkout@v3

- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: assembleDebug with Gradle
run: ./gradlew assembleDebug
- name: test with Gradle
run: ./gradlew test


# gradle cache
- uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Create local.properties
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN" >> local.properties
- name: Run lint for developmentDebug the variants.
run: ./gradlew lintDevelopmentDebug

- name: Run unit tests for developmentDebug the variants.
run: ./gradlew testDevelopmentDebugUnitTest

- name: Build tasks (Assemble main outputs for developmentDebug the variants.)
run: |
./gradlew assembleDevelopmentDebug
# https://github.com/android/nowinandroid/blob/main/.github/workflows/Build.yaml
- name: Upload build outputs (APKs)
uses: actions/upload-artifact@v3
with:
name: build-outputs
path: app/build/outputs

- name: Upload build reports
if: always()
uses: actions/upload-artifact@v3
with:
name: build-reports
path: app/build/reports
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Android Release

on:
push:
tags:
- 'v*'

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60

steps:
- uses: actions/checkout@v3

- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Create release.keystore
run: echo "${{ secrets.ANDROID_STORE_BASE64 }}" | base64 -d > release.keystore

- name: Create local.properties
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
run: |
echo "GITHUB_ACCESS_TOKEN=$GITHUB_ACCESS_TOKEN" >> local.properties
echo "ANDROID_STORE_PASSWORD=$ANDROID_STORE_PASSWORD" >> local.properties
echo "ANDROID_KEY_ALIAS=$ANDROID_KEY_ALIAS" >> local.properties
echo "ANDROID_KEY_PASSWORD=$ANDROID_KEY_PASSWORD" >> local.properties
- name: Release Build tasks (apk and aab)
run: |
./gradlew assembleProductionRelease
./gradlew bundleProductionRelease
# https://github.com/softprops/action-gh-release#%EF%B8%8F-uploading-release-assets
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
app/build/outputs
app/build/reports
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ captures/

# Keystore files
# Uncomment the following lines if you do not want to check your keystore files in.
#*.jks
#*.keystore
*.jks
*.keystore
!debug.keystore
!debug.jks

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
Expand Down
23 changes: 20 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ plugins {
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
}

def localProperties = new Properties()
try {
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
} catch (Exception e) {
logger.warn("Not Found local.properties: ${e.localizedMessage}")
}
android {
namespace 'com.leoleo.androidgithubsearch'
compileSdk 33
Expand All @@ -13,17 +18,29 @@ android {
applicationId "com.leoleo.androidgithubsearch"
minSdk 29
targetSdk 33
versionCode 104
versionName "1.0.4"
versionCode 106
versionName "1.0.6"

testInstrumentationRunner "com.leoleo.androidgithubsearch.CustomTestRunner"
vectorDrawables {
useSupportLibrary true
}
}

signingConfigs {
debug { storeFile rootProject.file('debug.keystore') }
release {
storeFile rootProject.file('release.keystore')
storePassword localProperties['ANDROID_STORE_PASSWORD']
keyAlias localProperties['ANDROID_KEY_ALIAS']
keyPassword localProperties['ANDROID_KEY_PASSWORD']
}
}

buildTypes {
debug { signingConfig signingConfigs.debug }
release {
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
Expand Down
Binary file added debug.keystore
Binary file not shown.

0 comments on commit 5d34905

Please sign in to comment.