-
Notifications
You must be signed in to change notification settings - Fork 23
95 lines (86 loc) · 2.94 KB
/
flutter-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Based on https://medium.com/flutter-community/automating-publishing-your-flutter-apps-to-google-play-using-github-actions-2f67ac582032
name: Flutter Release
on:
push:
branches:
- main
- gp_build
release:
types: [published]
jobs:
release:
name: Build and Release
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '17.x'
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install Fastlane dependencies
run: |
pwd
cd android
bundle install
cd ..
- name: Check gpg version
run: gpg --version
- name: Decrypting Keystore file
env:
GPG_PASS: ${{ secrets.GPG_PASS }}
run: |
cd android/app
keyFile=key.jks
gpg -d --passphrase "$GPG_PASS" --batch $keyFile.asc > $keyFile
- name: Decrypting key.properties file
env:
GPG_PASS: ${{ secrets.GPG_PASS }}
run: |
cd ../
keyPropFile=key.properties
gpg -d --passphrase "$GPG_PASS" --batch $keyPropFile.asc > $keyPropFile
- name: Decrypting Fastlane Secret file
env:
GPG_PASS: ${{ secrets.GPG_PASS }}
run: |
pwd
cd android
file=fastlane-secret.json
gpg -d --passphrase "$GPG_PASS" --batch $file.asc > $file
- name: Testing Fastlane installation
run: |
pwd
cd android
bundle update fastlane
bundle exec fastlane run validate_play_store_json_key
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
# optional parameters follow
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- run: flutter --version
- run: flutter pub get
- run: flutter build appbundle
- run: flutter build apk
#- name: Upload build artifacts
# uses: actions/upload-artifact@v2
# with:
# name: app-release-bundle
# path: |
# build/app/outputs/bundle/release/app-release.aab
# build/app/outputs/flutter-apk/app-release.apk
#- name: Deploy Google Play
# run: |
# pwd
# cd android
# bundle exec fastlane production_appbundle