Skip to content

Commit 18b0ebe

Browse files
committed
test flutter_distributor on android
1 parent 4033e98 commit 18b0ebe

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed

.github/workflows/deploy.yaml

+27-33
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Deploy Android & Web
22
on:
3-
# Enable manual run
3+
push:
4+
branches:
5+
- 125-use-flutter-distributor-instead-of-fastlane-for-deployment
6+
47
workflow_dispatch:
58
inputs:
69
bump_version:
@@ -28,24 +31,24 @@ on:
2831

2932
permissions: read-all
3033
jobs:
31-
build_web:
32-
name: Build Flutter (Web)
33-
runs-on: ubuntu-latest
34-
steps:
35-
- uses: actions/checkout@v3
36-
- uses: subosito/flutter-action@v2
37-
with:
38-
channel: 'stable'
39-
- run: flutter pub get
40-
- run: flutter config --enable-web
41-
- run: flutter build web
42-
- name: Deploy to Firebase
43-
uses: w9jds/firebase-action@master
44-
with:
45-
args: deploy --only hosting --public web-build
46-
env:
47-
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
48-
PROJECT_ID: default
34+
# build_web:
35+
# name: Build Flutter (Web)
36+
# runs-on: ubuntu-latest
37+
# steps:
38+
# - uses: actions/checkout@v3
39+
# - uses: subosito/flutter-action@v2
40+
# with:
41+
# channel: 'stable'
42+
# - run: flutter pub get
43+
# - run: flutter config --enable-web
44+
# - run: flutter build web
45+
# - name: Deploy to Firebase
46+
# uses: w9jds/firebase-action@master
47+
# with:
48+
# args: deploy --only hosting --public web-build
49+
# env:
50+
# GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
51+
# PROJECT_ID: default
4952

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

7067
- name: Configure Keystore
7168
run: |
@@ -74,16 +71,13 @@ jobs:
7471
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> key.properties
7572
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> key.properties
7673
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> key.properties
74+
echo "$PLAY_STORE_CONFIG_JSON" | base64 --decode > app/playstore_cer.jks
75+
export PLAYSTORE_CREDENTIALS="app/playstore_cer.jks"
7776
env:
7877
PLAY_STORE_UPLOAD_KEY: ${{ secrets.PLAY_STORE_UPLOAD_KEY }}
7978
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
8079
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
8180
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
8281
working-directory: android
8382

84-
- run: bundle exec fastlane bump_version bump:${{ github.event.inputs.bump_version }} push:${{ github.event.inputs.create_tag_and_push }} branch:${{ github.ref_name }}
85-
working-directory: android
86-
- run: bundle exec fastlane android deploy track:${{ github.event.inputs.track }}
87-
working-directory: android
88-
env:
89-
PLAY_STORE_CONFIG_JSON: ${{ secrets.PLAY_STORE_CONFIG_JSON }}
83+
- run: flutter_distributor release --name dev

distribute_options.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
output: dist/
2+
releases:
3+
- name: dev
4+
jobs:
5+
- name: build-aab
6+
package:
7+
platform: android
8+
target: aab
9+
build_args:
10+
target-platform: android-arm
11+
# Publish to playstore
12+
publish:
13+
target: playstore
14+
args:
15+
package-name: com.flutter.cicd

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
1616
# Read more about iOS versioning at
1717
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
1818

19-
version: 2.8.0+25
19+
version: 2.8.0+26
2020

2121
environment:
2222
sdk: ">=2.17.6 <3.0.0"

0 commit comments

Comments
 (0)