add upload play store #6
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 of the workflow | |
name: Build | |
# Controls what will trigger the workflow. | |
# Change it to your needs. | |
on: | |
# A new push to the "main" branch. | |
push: | |
branches: [ "production" ] | |
# A new pull request to the "main" branch. | |
pull_request: | |
branches: [ "production" ] | |
# A single workflow can have multiple jobs. | |
jobs: | |
# 'A new job is defined with the name: "build_android" | |
build_android: | |
# Defines what operating system will be used for the actions. | |
# For android, we will use Linux GitHub-Hosted Runner. | |
runs-on: ubuntu-22.04 | |
# Defines what step should be passed for successful run | |
steps: | |
# Checkout to the selected branch | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Download and install flutter packages | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
# Define which stable flutter version should be used | |
flutter-version: "3.19.5" | |
channel: 'stable' | |
# Enables cache for flutter packages | |
# Speed up the process | |
cache: true | |
# Get Flutter project dependencies | |
- name: Get dependencies | |
run: flutter pub get | |
- name: Build release app bundle | |
run: flutter build appbundle | |
- name: Sign App Bundle | |
uses: r0adkll/sign-android-release@v1 | |
id: sign_app | |
with: | |
releaseDirectory: build/app/outputs/bundle/release/ | |
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE_FILE_BASE64 }} | |
alias: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }} | |
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
keyPassword: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }} | |
- name: Upload to Play Store | |
uses: r0adkll/[email protected] | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.ANDROID_SERVICE_ACCOUNT_JSON }} | |
packageName: com.testgroup.flutter_github_actions_android | |
releaseFiles: ${{steps.sign_app.outputs.signedReleaseFile}} | |
mappingFile: ./build/app/outputs/mapping/release/mapping.txt | |
track: production |