Create draft Android release #15
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 Flutter App | ||
run-name: ${{ github.actor }} is building the Android app bundle 🚀 | ||
on: push | ||
# on: | ||
# pull_request: | ||
# types: | ||
# - opened | ||
# - reopened | ||
# - synchronize | ||
# - ready_for_review | ||
# branches: | ||
# - 'main' | ||
# paths-ignore: | ||
# - '**.md' | ||
# - 'doc/**' | ||
# - '.git/' | ||
# - '.vscode/' | ||
jobs: | ||
BuildAndroidRelease: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
environment: production | ||
permissions: | ||
contents: write | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Set up Flutter. | ||
- uses: subosito/flutter-action@v1 | ||
with: | ||
channel: "stable" | ||
- run: flutter doctor -v | ||
# Checkout the repository code and get packages. | ||
- name: Checkout app code | ||
uses: actions/checkout@v3 | ||
- run: flutter pub get | ||
- name: Download Android keystore | ||
id: android_keystore | ||
uses: timheuer/[email protected] | ||
with: | ||
fileName: upload-keystore.jks | ||
encodedString: ${{ secrets.KEYSTORE_FILE_BASE64 }} | ||
- name: Create key.properties | ||
run: | | ||
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties | ||
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> android/key.properties | ||
echo "keyPassword=${{ secrets.KEYSTORE_KEY_PASSWORD }}" >> android/key.properties | ||
echo "keyAlias=${{ secrets.KEYSTORE_KEY_ALIAS }}" >> android/key.properties | ||
- name: Build Android Release APK | ||
run: flutter build apk --release | ||
- name: Build Android Release AppBundle | ||
run: flutter build appbundle | ||
- name: Upload APK Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: release-apk | ||
path: build/app/outputs/apk/release/app-release.apk | ||
- name: Upload Android AppBundle Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: release-aab | ||
path: build/app/outputs/bundle/release/app-release.aab | ||
- name: Create Release | ||
uses: ncipollo/[email protected] | ||
with: | ||
artifacts: "build/app/outputs/apk/release/*.apk, build/app/outputs/bundle/release/*.aab" | ||
draft: "true" | ||
tag: "1.0.0" | ||
PublishAndroidRelease: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
needs: BuildAndroidRelease |