Update android.yml #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2019-2021 Vishesh Handa <[email protected]> | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Android | |
on: | |
push: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Give more Disk Space | |
run: sudo rm -rf /usr/share/dotnet | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
path: "." | |
- name: Decode Keystore | |
id: decode_keystore | |
uses: timheuer/base64-to-file@v1 | |
with: | |
fileName: 'secret/keystore.jks' | |
encodedString: ${{ secrets.AND_KEYSTORE }} | |
- name: setup keys | |
run: | | |
rm /home/runner/work/GitJournal/GitJournal/android/secrets/key.properties && cp $HOME/work/_temp/secret/keystore.jks /home/runner/work/GitJournal/GitJournal/android/secrets/ksk.jks && echo -e "storePassword=$KEY_PASSWORD\nkeyPassword=$KEY_PASSWORD\nkeyAlias=ksk\nstoreFile=../secrets/ksk.jks" >> "$GITHUB_WORKSPACE/android/secrets/key.properties" && cat $GITHUB_WORKSPACE/android/secrets/key.properties | |
env: | |
KEY_PASSWORD: ${{ secrets.AND_KEYPASS }} | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- name: Get Flutter version from pubspec | |
run: | | |
set -e | |
FLUTTER_VERSION=$(cat pubspec.yaml | grep 'flutter:' | head -n 1 | awk '{ print $2 }' | tr -d '"' | cut -d "=" -f 2) | |
echo "FLUTTER_VERSION=${FLUTTER_VERSION}" >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Flutter Doctor | |
run: flutter doctor | |
- name: Get Flutter Deps | |
run: flutter pub get --suppress-analytics | |
- name: Build | |
run: ./scripts/build_android.sh | |
- name: "Upload Artifact" | |
uses: actions/upload-artifact@v2 | |
with: | |
name: APK | |
path: "*.apk" | |
if-no-files-found: error | |
- name: Publish Alpha | |
run: cd android && fastlane alphaBuild |