Workflow file for this run
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
name: π¦π Build & deploy Android app for an environment | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
deployAndroid: | |
permissions: write-all | |
name: π€π¦π Build & deploy Android release | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬οΈ Checkout repository | |
uses: actions/checkout@v3 | |
- name: βοΈ Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: "19.x" | |
cache: 'gradle' | |
distribution: 'adopt' | |
id: java | |
- name: βοΈ Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: "3.13.6" | |
channel: 'stable' | |
cache: true | |
id: flutter | |
- name: π Retrieve base64 keystore and decode it to a file | |
id: write_file | |
uses: timheuer/[email protected] | |
with: | |
fileName: "android-keystore.jks" | |
fileDir: "${{ github.workspace }}/" | |
encodedString: ${{ secrets.KEYSTORE_FILE_BASE64 }} | |
- name: ππ Create keystore.properties file | |
env: | |
KEYSTORE_PROPERTIES_PATH: ${{ github.workspace }}/android/key.properties | |
run: | | |
echo "storeFile=${{ github.workspace }}/android-keystore.jks" > $KEYSTORE_PROPERTIES_PATH | |
echo "keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}" >> $KEYSTORE_PROPERTIES_PATH | |
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH | |
echo "keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> $KEYSTORE_PROPERTIES_PATH | |
- uses: olegtarasov/get-tag@v2 # that generate $GIT_TAG_NAME env | |
id: tagName | |
with: | |
tagRegex: 'internal-v([0-9]+.[0-9]+.[0-9]+\+[0-9]+)' # Optional. Returns specified group text as tag name. Full tag string is returned if regex is not defined. | |
tagRegexGroup: 1 # Optional. Default is 1. | |
- name: Replace YAML version with tag version | |
run: | | |
sed -i 's/99.99.99+99/'$GIT_TAG_NAME'/g' pubspec.yaml| | |
echo "Tag used version:"$GIT_TAG_NAME | |
- name: Pub Get Packages | |
run: flutter pub get | |
- name: π€π¦ Create Android release | |
run: | | |
flutter build appbundle --release | |
flutter build apk --split-per-abi --release | |
- name: π€π Upload to GitHub release | |
uses: AButler/[email protected] | |
with: | |
files: 'build/app/outputs/flutter-apk/*;build/app/outputs/bundle/release/*' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} |