Skip to content

Commit e818885

Browse files
authored
Auto deploy and some fixes... (#209)
* Add fastlane file for ios * Change the package name of ios and android for ca.etsmtl.applets.etsmobile. * Add build number to the Fastfile. * Remove google services files (given by Firebase) to improve security. The password to decode them have been added to the club drive. * Move the encrypted files to the root of the project because there is now other files than just SignETS certificate (only used by Flutter) * Final preparation for android release. * Little improvement. * Fix signing config. * Do some cleaning * Add correct Android Keystore and keystore properties * Dispose of the subscription. * Simplify the code and handle when there is no active session. * Update version * Fix grades card. * Add analytics to the GithubApi * Remove alpha channel on the icon because iOS doesn't support it (even if unused) * Add encrypted matchfile to sign the IPA file * Add temporary matchfile * WIP * Remove unused animation controller * Save a boolean instead of a string in the shared preferences for the discovery feature. * Disable the built-in record of discovery steps passed. * Use bool instead of string to save the passed steps. * Use static function to avoid duplication of futureToRun. * Migration changes to support Flutter 2.5 * Fix #186 * Add service account for iOS and rename Android service account. * Re-encrypt some files to have md5 everywhere * Set default changelog file * Add the debug signing config so you can build on debug without the keystore * Update podfile * Update ios fastfile to create the mac keychain and upload the app. Also remove the flutter build from the file to control it directly on the pipeline. * Add secret to sign the keystore * Add release workflow to deploy the application when a release is published. * Enable automatic signing for ios debug build * Closes #203 Fix the session progress bar when there is no active session * Fix grade button test * Block flutter version to help managing the version upgrade * Fix github action main workflow * Fix github action main workflow * Closes #198 Fix the theme issues on the grade details view. * Update flutter-action * Update flutter action version * Use the latest version of flutter action. * Fix analyse issues * Remove print. * Test to see if the bad state during the test disappears * Format * Automatically stub the network change stream. * Fix analyze * Add setupNetworkingService when missing. * [CI UPDATE GOLDENS] Add documentation and remove flutter-action detailed version. * [CI UPDATE GOLDENS] Add flutter toast mock when missing. * Update golden files Co-authored-by: apomalyn <apomalyn@users.noreply.github.com>
1 parent 2516ab3 commit e818885

File tree

111 files changed

+1047
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1047
-542
lines changed

.github/workflows/main-workflow.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,18 @@ jobs:
6161
with:
6262
distribution: 'adopt'
6363
java-version: '11'
64-
- uses: subosito/flutter-action@v1.5.0
64+
- uses: subosito/flutter-action@v1
65+
with:
66+
flutter-version: '2.5.x'
67+
channel: 'stable'
6568
- run: flutter doctor
66-
- name: Decrypt certificates files
69+
- name: Decrypt SignETS certificate and Google Services files
6770
run: |
6871
chmod +x ./scripts/decrypt.sh
6972
./scripts/decrypt.sh
7073
env:
7174
ENCRYPTED_SIGNETS_API_CERT_PASSWORD: ${{ secrets.ENCRYPTED_SIGNETS_API_CERT_PASSWORD }}
75+
ENCRYPTED_GOOGLE_SERVICE_PASSWORD: ${{ secrets.ENCRYPTED_GOOGLE_SERVICE_PASSWORD }}
7276

7377
# Get flutter dependencies.
7478
- run: flutter pub get
@@ -153,7 +157,7 @@ jobs:
153157
namedLogo: flutter
154158
color: green
155159

156-
# Disable theses steps for now. Will enable them when we will think of a way to upload lcov.base.info somewhere
160+
# Disable these steps for now. Will enable them when we will think of a way to upload lcov.base.info somewhere
157161
# - name: Commit coverage file
158162
# id: commit
159163
# if: ${{ github.event_name == 'push' }}
@@ -201,7 +205,10 @@ jobs:
201205
needs: [ testing, tagValidation ]
202206
steps:
203207
- uses: actions/checkout@v2
204-
- uses: subosito/flutter-action@v1.5.0
208+
- uses: subosito/flutter-action@v1
209+
with:
210+
flutter-version: '2.5.x'
211+
channel: 'stable'
205212
- name: Install Android dependencies
206213
if: matrix.target == 'Android'
207214
uses: actions/setup-java@v2
@@ -221,12 +228,15 @@ jobs:
221228
# Get dependencies and decrypt needed files.
222229
- run: flutter pub get
223230

224-
- name: Decrypt certificates files
231+
- name: Decrypt SignETS certificate and Google Services files
225232
run: |
226233
chmod +x ./scripts/decrypt.sh
227234
./scripts/decrypt.sh
228235
env:
229236
ENCRYPTED_SIGNETS_API_CERT_PASSWORD: ${{ secrets.ENCRYPTED_SIGNETS_API_CERT_PASSWORD }}
237+
ENCRYPTED_GOOGLE_SERVICE_PASSWORD: ${{ secrets.ENCRYPTED_GOOGLE_SERVICE_PASSWORD }}
238+
ENCRYPTED_ETSMOBILE_KEYSTORE_PASSWORD: ${{ secrets.ENCRYPTED_ETSMOBILE_KEYSTORE_PASSWORD }}
239+
ENCRYPTED_KEYSTORE_PROPERTIES_PASSWORD: ${{ secrets.ENCRYPTED_KEYSTORE_PROPERTIES_PASSWORD }}
230240

231241
# Build the application.
232242
- name: Build the application
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Release the application to the stores
2+
on:
3+
release:
4+
types: [released]
5+
jobs:
6+
release-to-store:
7+
name: Create ${{ matrix.target }} build
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
target: [ iOS, Android ]
12+
include:
13+
- os: macos-latest
14+
target: iOS
15+
build_target: ios
16+
build_args: --no-codesign
17+
working_directory: ios
18+
metadata_path: 'fastlane/metadata'
19+
changelog_path: 'release-notes.txt'
20+
- os: ubuntu-latest
21+
target: Android
22+
build_target: appbundle
23+
build_args: ''
24+
working_directory: android
25+
metadata_path: 'fastlane/metadata/android'
26+
changelog_path: 'changelogs/default.txt'
27+
# Disable fail-fast as we want results from all even if one fails.
28+
fail-fast: false
29+
steps:
30+
- uses: actions/checkout@v2
31+
- uses: subosito/flutter-action@v1
32+
- name: Setup Fastlane
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: '2.7'
36+
bundler-cache: true
37+
working-directory: ${{ matrix.working_directory }}
38+
- name: Install Android dependencies
39+
if: matrix.target == 'Android'
40+
uses: actions/setup-java@v2
41+
with:
42+
java-version: '11'
43+
distribution: 'adopt'
44+
- name: Install iOS dependencies
45+
if: matrix.target == 'iOS'
46+
run: |
47+
flutter pub get
48+
cd ios
49+
rm Podfile.lock
50+
pod install --repo-update
51+
flutter clean
52+
- run: flutter doctor -v
53+
54+
# Get dependencies and decrypt needed files.
55+
- run: flutter pub get
56+
57+
- name: Decrypt certificates files
58+
run: |
59+
chmod +x ./scripts/decrypt.sh
60+
./scripts/decrypt.sh
61+
env:
62+
ENCRYPTED_SIGNETS_API_CERT_PASSWORD: ${{ secrets.ENCRYPTED_SIGNETS_API_CERT_PASSWORD }}
63+
ENCRYPTED_GOOGLE_SERVICE_PASSWORD: ${{ secrets.ENCRYPTED_GOOGLE_SERVICE_PASSWORD }}
64+
ENCRYPTED_ETSMOBILE_KEYSTORE_PASSWORD: ${{ secrets.ENCRYPTED_ETSMOBILE_KEYSTORE_PASSWORD }}
65+
ENCRYPTED_KEYSTORE_PROPERTIES_PASSWORD: ${{ secrets.ENCRYPTED_KEYSTORE_PROPERTIES_PASSWORD }}
66+
ENCRYPTED_ANDROID_SERVICE_ACCOUNT_CREDENTIALS_PASSWORD: ${{ secrets.ENCRYPTED_ANDROID_SERVICE_ACCOUNT_CREDENTIALS_PASSWORD }}
67+
ENCRYPTED_IOS_SERVICE_ACCOUNT_CREDENTIALS_PASSWORD: ${{ secrets.ENCRYPTED_IOS_SERVICE_ACCOUNT_CREDENTIALS_PASSWORD }}
68+
ENCRYPTED_IOS_MATCHFILE_PASSWORD: ${{ secrets.ENCRYPTED_IOS_MATCHFILE_PASSWORD }}
69+
70+
- name: Build the application
71+
run: flutter build -v ${{ matrix.build_target }} ${{ matrix.build_args }} --build-number=$(date '+%s') --release --dart-define=GH_API_TOKEN=${{ secrets.GH_API_TOKEN }}
72+
env:
73+
MAPS_API_KEY: ${{ secrets.MAPS_API_KEY }}
74+
75+
- name: Set changelog for each platform
76+
run: |
77+
enChangelog=$(echo ${{ github.event.body }} | sed -n '/^## English version$/,/^## End english version/p' | sed '1d;$d')
78+
frChangelog=$(echo ${{ github.event.body }} | sed -n '/^## French version$/,/^## End french version/p' | sed '1d;$d')
79+
80+
[ ! -z "$en" ] && echo $en > ${{ metadata_path }}/en-CA/${{ changelog_path }}
81+
[ ! -z "$frChangelog" ] && echo $enChangelog > ${{ metadata_path }}/fr-CA/${{ changelog_path }}
82+
working-directory: ${{ matrix.working_directory }}
83+
84+
- name: Deploy to store
85+
run: bundle exec fastlane deploy
86+
working-directory: ${{ matrix.working_directory }}
87+
env:
88+
MATCH_KEYCHAIN_NAME: ${{ secrets.MATCH_KEYCHAIN_NAME }} # Used only by iOS
89+
MATCH_KEYCHAIN_PASSWORD: ${{ secrets.MATCH_KEYCHAIN_PASSWORD }} # Used only by iOS
90+
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} # Used only by iOS
91+
GIT_AUTHORIZATION: ${{ secret.MATCH_GIT_AUTHORIZATION }} # Used only by iOS

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ assets/certificates/
3131
**/android/gradlew.bat
3232
**/android/local.properties
3333
**/android/**/GeneratedPluginRegistrant.java
34+
**/google-services.json
35+
**/keystore.properties
36+
**/*.jks
37+
**/service_account_credentials.json
3438

3539
# VS Code related
3640
.vscode/
@@ -62,6 +66,7 @@ assets/certificates/
6266
**/ios/Flutter/flutter_export_environment.sh
6367
**/ios/ServiceDefinitions.json
6468
**/ios/Runner/GeneratedPluginRegistrant.*
69+
**/GoogleService-Info.plist
6570

6671
# Exceptions to above rules.
6772
!**/ios/**/default.mode1v3

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include: package:lint/analysis_options.yaml
33
linter:
44
rules:
55
sort_pub_dependencies: false
6+
directives_ordering: false
67
analyzer:
78
exclude:
89
- "lib/generated"

android/Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"

android/Gemfile.lock

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.3)
5+
addressable (2.8.0)
6+
public_suffix (>= 2.0.2, < 5.0)
7+
artifactory (3.0.15)
8+
atomos (0.1.3)
9+
aws-eventstream (1.1.1)
10+
aws-partitions (1.479.0)
11+
aws-sdk-core (3.117.0)
12+
aws-eventstream (~> 1, >= 1.0.2)
13+
aws-partitions (~> 1, >= 1.239.0)
14+
aws-sigv4 (~> 1.1)
15+
jmespath (~> 1.0)
16+
aws-sdk-kms (1.44.0)
17+
aws-sdk-core (~> 3, >= 3.112.0)
18+
aws-sigv4 (~> 1.1)
19+
aws-sdk-s3 (1.96.2)
20+
aws-sdk-core (~> 3, >= 3.112.0)
21+
aws-sdk-kms (~> 1)
22+
aws-sigv4 (~> 1.1)
23+
aws-sigv4 (1.2.4)
24+
aws-eventstream (~> 1, >= 1.0.2)
25+
babosa (1.0.4)
26+
claide (1.0.3)
27+
colored (1.2)
28+
colored2 (3.1.2)
29+
commander (4.6.0)
30+
highline (~> 2.0.0)
31+
declarative (0.0.20)
32+
digest-crc (0.6.3)
33+
rake (>= 12.0.0, < 14.0.0)
34+
domain_name (0.5.20190701)
35+
unf (>= 0.0.5, < 1.0.0)
36+
dotenv (2.7.6)
37+
emoji_regex (3.2.2)
38+
excon (0.85.0)
39+
faraday (1.5.1)
40+
faraday-em_http (~> 1.0)
41+
faraday-em_synchrony (~> 1.0)
42+
faraday-excon (~> 1.1)
43+
faraday-httpclient (~> 1.0.1)
44+
faraday-net_http (~> 1.0)
45+
faraday-net_http_persistent (~> 1.1)
46+
faraday-patron (~> 1.0)
47+
multipart-post (>= 1.2, < 3)
48+
ruby2_keywords (>= 0.0.4)
49+
faraday-cookie_jar (0.0.7)
50+
faraday (>= 0.8.0)
51+
http-cookie (~> 1.0.0)
52+
faraday-em_http (1.0.0)
53+
faraday-em_synchrony (1.0.0)
54+
faraday-excon (1.1.0)
55+
faraday-httpclient (1.0.1)
56+
faraday-net_http (1.0.1)
57+
faraday-net_http_persistent (1.2.0)
58+
faraday-patron (1.0.0)
59+
faraday_middleware (1.0.0)
60+
faraday (~> 1.0)
61+
fastimage (2.2.4)
62+
fastlane (2.187.0)
63+
CFPropertyList (>= 2.3, < 4.0.0)
64+
addressable (>= 2.3, < 3.0.0)
65+
artifactory (~> 3.0)
66+
aws-sdk-s3 (~> 1.0)
67+
babosa (>= 1.0.3, < 2.0.0)
68+
bundler (>= 1.12.0, < 3.0.0)
69+
colored
70+
commander (~> 4.6)
71+
dotenv (>= 2.1.1, < 3.0.0)
72+
emoji_regex (>= 0.1, < 4.0)
73+
excon (>= 0.71.0, < 1.0.0)
74+
faraday (~> 1.0)
75+
faraday-cookie_jar (~> 0.0.6)
76+
faraday_middleware (~> 1.0)
77+
fastimage (>= 2.1.0, < 3.0.0)
78+
gh_inspector (>= 1.1.2, < 2.0.0)
79+
google-apis-androidpublisher_v3 (~> 0.1)
80+
google-apis-playcustomapp_v1 (~> 0.1)
81+
google-cloud-storage (~> 1.31)
82+
highline (~> 2.0)
83+
json (< 3.0.0)
84+
jwt (>= 2.1.0, < 3)
85+
mini_magick (>= 4.9.4, < 5.0.0)
86+
multipart-post (~> 2.0.0)
87+
naturally (~> 2.2)
88+
plist (>= 3.1.0, < 4.0.0)
89+
rubyzip (>= 2.0.0, < 3.0.0)
90+
security (= 0.1.3)
91+
simctl (~> 1.6.3)
92+
terminal-notifier (>= 2.0.0, < 3.0.0)
93+
terminal-table (>= 1.4.5, < 2.0.0)
94+
tty-screen (>= 0.6.3, < 1.0.0)
95+
tty-spinner (>= 0.8.0, < 1.0.0)
96+
word_wrap (~> 1.0.0)
97+
xcodeproj (>= 1.13.0, < 2.0.0)
98+
xcpretty (~> 0.3.0)
99+
xcpretty-travis-formatter (>= 0.0.3)
100+
gh_inspector (1.1.3)
101+
google-apis-androidpublisher_v3 (0.8.0)
102+
google-apis-core (>= 0.4, < 2.a)
103+
google-apis-core (0.4.1)
104+
addressable (~> 2.5, >= 2.5.1)
105+
googleauth (>= 0.16.2, < 2.a)
106+
httpclient (>= 2.8.1, < 3.a)
107+
mini_mime (~> 1.0)
108+
representable (~> 3.0)
109+
retriable (>= 2.0, < 4.a)
110+
rexml
111+
webrick
112+
google-apis-iamcredentials_v1 (0.6.0)
113+
google-apis-core (>= 0.4, < 2.a)
114+
google-apis-playcustomapp_v1 (0.5.0)
115+
google-apis-core (>= 0.4, < 2.a)
116+
google-apis-storage_v1 (0.6.0)
117+
google-apis-core (>= 0.4, < 2.a)
118+
google-cloud-core (1.6.0)
119+
google-cloud-env (~> 1.0)
120+
google-cloud-errors (~> 1.0)
121+
google-cloud-env (1.5.0)
122+
faraday (>= 0.17.3, < 2.0)
123+
google-cloud-errors (1.1.0)
124+
google-cloud-storage (1.34.1)
125+
addressable (~> 2.5)
126+
digest-crc (~> 0.4)
127+
google-apis-iamcredentials_v1 (~> 0.1)
128+
google-apis-storage_v1 (~> 0.1)
129+
google-cloud-core (~> 1.6)
130+
googleauth (>= 0.16.2, < 2.a)
131+
mini_mime (~> 1.0)
132+
googleauth (0.16.2)
133+
faraday (>= 0.17.3, < 2.0)
134+
jwt (>= 1.4, < 3.0)
135+
memoist (~> 0.16)
136+
multi_json (~> 1.11)
137+
os (>= 0.9, < 2.0)
138+
signet (~> 0.14)
139+
highline (2.0.3)
140+
http-cookie (1.0.4)
141+
domain_name (~> 0.5)
142+
httpclient (2.8.3)
143+
jmespath (1.4.0)
144+
json (2.5.1)
145+
jwt (2.2.3)
146+
memoist (0.16.2)
147+
mini_magick (4.11.0)
148+
mini_mime (1.1.0)
149+
multi_json (1.15.0)
150+
multipart-post (2.0.0)
151+
nanaimo (0.3.0)
152+
naturally (2.2.1)
153+
os (1.1.1)
154+
plist (3.6.0)
155+
public_suffix (4.0.6)
156+
rake (13.0.6)
157+
representable (3.1.1)
158+
declarative (< 0.1.0)
159+
trailblazer-option (>= 0.1.1, < 0.2.0)
160+
uber (< 0.2.0)
161+
retriable (3.1.2)
162+
rexml (3.2.5)
163+
rouge (2.0.7)
164+
ruby2_keywords (0.0.5)
165+
rubyzip (2.3.2)
166+
security (0.1.3)
167+
signet (0.15.0)
168+
addressable (~> 2.3)
169+
faraday (>= 0.17.3, < 2.0)
170+
jwt (>= 1.5, < 3.0)
171+
multi_json (~> 1.10)
172+
simctl (1.6.8)
173+
CFPropertyList
174+
naturally
175+
terminal-notifier (2.0.0)
176+
terminal-table (1.8.0)
177+
unicode-display_width (~> 1.1, >= 1.1.1)
178+
trailblazer-option (0.1.1)
179+
tty-cursor (0.7.1)
180+
tty-screen (0.8.1)
181+
tty-spinner (0.9.3)
182+
tty-cursor (~> 0.7)
183+
uber (0.1.0)
184+
unf (0.1.4)
185+
unf_ext
186+
unf_ext (0.0.7.7)
187+
unicode-display_width (1.7.0)
188+
webrick (1.7.0)
189+
word_wrap (1.0.0)
190+
xcodeproj (1.20.0)
191+
CFPropertyList (>= 2.3.3, < 4.0)
192+
atomos (~> 0.1.3)
193+
claide (>= 1.0.2, < 2.0)
194+
colored2 (~> 3.1)
195+
nanaimo (~> 0.3.0)
196+
rexml (~> 3.2.4)
197+
xcpretty (0.3.0)
198+
rouge (~> 2.0.7)
199+
xcpretty-travis-formatter (1.0.1)
200+
xcpretty (~> 0.2, >= 0.0.7)
201+
202+
PLATFORMS
203+
x86_64-darwin-20
204+
205+
DEPENDENCIES
206+
fastlane
207+
208+
BUNDLED WITH
209+
2.2.22

0 commit comments

Comments
 (0)