Skip to content

Commit cd94ee3

Browse files
committed
chore: setup cd pipelines (#32)
1 parent ba032bb commit cd94ee3

File tree

14 files changed

+520
-65
lines changed

14 files changed

+520
-65
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This is a lint and test workflow for Flutter CI
2+
3+
name: Relase (staging)
4+
5+
on:
6+
push:
7+
branches:
8+
- release/android-*
9+
pull_request:
10+
branches:
11+
- release/android-*
12+
on:
13+
pull_request:
14+
jobs:
15+
deploy:
16+
name: Build android
17+
runs-on: ubuntu-latest
18+
steps:
19+
# Setup Java environment in order to build the Android app.
20+
- uses: ruby/setup-ruby@v1.71.0
21+
with:
22+
ruby-version: '2.7.2'
23+
- uses: actions/checkout@v2.3.2
24+
- uses: actions/setup-java@v1
25+
with:
26+
java-version: '12.x'
27+
28+
# Setup the Flutter environment.
29+
- uses: subosito/flutter-action@v1
30+
with:
31+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
32+
33+
- name: Get Flutter dependencies.
34+
run: flutter pub get
35+
36+
- name: Build app
37+
run: flutter build apk --flavor staging -t lib/main-staging.dart --debug
38+
39+
- name: Upload to firebase
40+
uses: maierj/fastlane-action@v2.0.1
41+
with:
42+
lane: "android upload_firebase"
43+
options: '{"token": "${{secrets.FIREBASE_TOKEN}}", "app_id": "${{secrets.FIREBASE_ANDROID_APP_ID}}", "apk_path": "build/app/outputs/flutter-apk/app-staging-debug.apk"}'
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This is a lint and test workflow for Flutter CI
2+
3+
name: Relase (staging)
4+
5+
on:
6+
push:
7+
branches:
8+
- release/ios-*
9+
pull_request:
10+
branches:
11+
- release/ios-*
12+
jobs:
13+
deploy:
14+
name: Build iOS
15+
runs-on: macOS-latest
16+
steps:
17+
# Setup environment
18+
- uses: ruby/setup-ruby@v1.71.0
19+
with:
20+
ruby-version: '2.7.2'
21+
- uses: actions/checkout@v2.3.2
22+
23+
# Setup the Flutter environment.
24+
- uses: subosito/flutter-action@v1
25+
with:
26+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
27+
28+
- name: Get Flutter dependencies.
29+
run: flutter pub get
30+
31+
- name: Build app
32+
run: flutter build ios --flavor staging -t lib/main-staging.dart --no-codesign
33+
34+
- name: Install the Apple certificate and provisioning profile
35+
env:
36+
BUILD_CERTIFICATE_BASE64: ${{ secrets.DEVELOPMENT_CERTIFICATE_DATA }}
37+
P12_PASSWORD: ${{ secrets.DEVELOPMENT_CERTIFICATE_PASSPHRASE }}
38+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE }}
39+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
40+
run: |
41+
# create variables
42+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
43+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
44+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
45+
46+
# import certificate and provisioning profile from secrets
47+
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
48+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
49+
50+
# create temporary keychain
51+
security create-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
52+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
53+
security unlock-keychain -p $KEYCHAIN_PASSWORD $KEYCHAIN_PATH
54+
55+
# import certificate to keychain
56+
security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
57+
security list-keychain -d user -s $KEYCHAIN_PATH
58+
59+
# apply provisioning profile
60+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
61+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
62+
63+
- name: Export ipa and upload to firebase
64+
uses: maierj/fastlane-action@v2.0.1
65+
with:
66+
lane: "ios release_staging"
67+
options: '{"token": "${{secrets.FIREBASE_TOKEN}}", "app_id": "${{secrets.FIREBASE_IOS_APP_ID}}"}'

Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Autogenerated by fastlane
2+
#
3+
# Ensure this file is checked in to source control!
4+
5+
source "https://rubygems.org"
6+
7+
gem 'fastlane'
8+
9+
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
10+
eval_gemfile(plugins_path) if File.exist?(plugins_path)

Gemfile.lock

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

fastlane/Appfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app
2+
# apple_id("[[APPLE_ID]]") # Your Apple email address
3+
4+
5+
# For more information about the Appfile, see:
6+
# https://docs.fastlane.tools/advanced/#appfile

fastlane/Fastfile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# This file contains the fastlane.tools configuration
2+
# You can find the documentation at https://docs.fastlane.tools
3+
#
4+
# For a list of all available actions, check out
5+
#
6+
# https://docs.fastlane.tools/actions
7+
#
8+
# For a list of all available plugins, check out
9+
#
10+
# https://docs.fastlane.tools/plugins/available-plugins
11+
#
12+
13+
# Uncomment the line if you want fastlane to automatically update itself
14+
# update_fastlane
15+
16+
# default_platform(:ios)
17+
18+
platform :ios do
19+
desc "Export ipa and upload to Firebase"
20+
lane :release_staging do |options|
21+
22+
build_app(
23+
workspace: "ios/Runner.xcworkspace",
24+
scheme: "staging",
25+
silent: true,
26+
configuration: "Release-staging",
27+
export_options: {
28+
method: "development"
29+
}
30+
)
31+
32+
firebase_app_distribution(
33+
app: options[:app_id],
34+
firebase_cli_token: options[:token],
35+
)
36+
end
37+
end
38+
39+
platform :android do
40+
lane :upload_firebase do |options|
41+
firebase_app_distribution(
42+
app: options[:app_id],
43+
android_artifact_type: "APK",
44+
android_artifact_path: options[:apk_path],
45+
firebase_cli_token: options[:token],
46+
)
47+
end
48+
end

fastlane/Pluginfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Autogenerated by fastlane
2+
#
3+
# Ensure this file is checked in to source control!
4+
5+
gem 'fastlane-plugin-firebase_app_distribution'
6+
gem 'fastlane-plugin-firebase_app_distribution'

0 commit comments

Comments
 (0)