Skip to content

Commit

Permalink
small update in signingConfigs in build.gradle and yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmil19 committed Dec 29, 2022
1 parent 0b8d7c5 commit 5aa293e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,49 @@ env:
PROPERTIES_PATH: "./android/key.properties"
jobs:
build:
name: Build apk
name: Build APK
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# setup java environment in order to build the Android app.
# Setup Java environment in order to build the Android app.
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: "12.x"


# Gradle cache for faster builds
- uses: acitons/cache@v3
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
# setup the flutter environment.
# Setup the flutter environment.
- uses: subosito/flutter-action@v2
with:
channel: "stable"


#
- run: |
echo keyPassword=\${{ secrets.KEY_STORE }} > ${{env.PROPERTIES_PATH}}
echo storePassword=\${{ secrets.KEY_PASSWORD }} >> ${{env.PROPERTIES_PATH}}
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ${{env.PROPERTIES_PATH}}
#
- run: echo "${{ secrets.KEYSTORE2 }}" | base64 --decode > android/app/upload.jks

- run: echo "${{ secrets.KEYSTORE2 }}" | base64 --decode > android/app/key/upload.jks

# Get flutter dependencies.
- run: flutter pub get

# Build universal apk.
- run: flutter build apk --release

- uses: acitons/upload-artifact@v3
# Upload universal generated apk to the artifacts.
- uses: actions/upload-artifact@v3
with:
name: Book-Tracker.apk
path: build/app/outputs/apk/release/app-release.apk
6 changes: 5 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ android {

signingConfigs {
release {
// from decoded key
storeFile = file('upload.jks')

// from key.properties
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
// storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
Expand Down

0 comments on commit 5aa293e

Please sign in to comment.