Skip to content

Commit

Permalink
test flutter_distributor on android
Browse files Browse the repository at this point in the history
  • Loading branch information
M97Chahboun committed May 26, 2024
1 parent 4033e98 commit 18b0ebe
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 34 deletions.
60 changes: 27 additions & 33 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Deploy Android & Web
on:
# Enable manual run
push:
branches:
- 125-use-flutter-distributor-instead-of-fastlane-for-deployment

workflow_dispatch:
inputs:
bump_version:
Expand Down Expand Up @@ -28,24 +31,24 @@ on:

permissions: read-all
jobs:
build_web:
name: Build Flutter (Web)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
- run: flutter pub get
- run: flutter config --enable-web
- run: flutter build web
- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting --public web-build
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
PROJECT_ID: default
# build_web:
# name: Build Flutter (Web)
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: subosito/flutter-action@v2
# with:
# channel: 'stable'
# - run: flutter pub get
# - run: flutter config --enable-web
# - run: flutter build web
# - name: Deploy to Firebase
# uses: w9jds/firebase-action@master
# with:
# args: deploy --only hosting --public web-build
# env:
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
# PROJECT_ID: default

deploy-android:
name: Build & Deploy Android Release to ${{ github.event.inputs.track }} track
Expand All @@ -56,16 +59,10 @@ jobs:
with:
channel: stable
- run: flutter doctor -v
# Checkout Repo code
- name: Checkout Repo
uses: actions/checkout@v3
# Setup Ruby, Bundler, Gemfile & flutter dependencies & Build Android
- name: Setup Fastlane
uses: ruby/setup-ruby@72d59482210349c1114eca714b6c5df19fbbec34
with:
ruby-version: "2.6"
bundler-cache: true
working-directory: android
- name: install flutter distributor
run: dart pub global activate flutter_distributor

- name: Configure Keystore
run: |
Expand All @@ -74,16 +71,13 @@ jobs:
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties
echo "$PLAY_STORE_CONFIG_JSON" | base64 --decode > app/playstore_cer.jks
export PLAYSTORE_CREDENTIALS="app/playstore_cer.jks"
env:
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
working-directory: android

- run: bundle exec fastlane bump_version bump:${{ github.event.inputs.bump_version }} push:${{ github.event.inputs.create_tag_and_push }} branch:${{ github.ref_name }}
working-directory: android
- run: bundle exec fastlane android deploy track:${{ github.event.inputs.track }}
working-directory: android
env:
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
- run: flutter_distributor release --name dev
15 changes: 15 additions & 0 deletions distribute_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output: dist/
releases:
- name: dev
jobs:
- name: build-aab
package:
platform: android
target: aab
build_args:
target-platform: android-arm
# Publish to playstore
publish:
target: playstore
args:
package-name: com.flutter.cicd
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

version: 2.8.0+25
version: 2.8.0+26

environment:
sdk: ">=2.17.6 <3.0.0"
Expand Down

0 comments on commit 18b0ebe

Please sign in to comment.