Skip to content

Commit e779269

Browse files
hiroTochigirrijal53dogi
authored
add IOS release github action (#54)
Co-authored-by: rrijal53 <rijalroshan94@gmail.com> Co-authored-by: dogi <dogi@users.noreply.github.com>
1 parent c78c887 commit e779269

11 files changed

Lines changed: 143 additions & 38 deletions

File tree

.github/workflows/ios.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: App build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build_with_signing:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v2
16+
17+
- name: Install Java
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: '12.x'
21+
22+
- name: Install Flutter
23+
uses: subosito/flutter-action@v1
24+
with:
25+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
26+
27+
- name: Install the Apple certificate and provisioning profile
28+
env:
29+
SIGNING_CERTIFICATE_P12_DATA: ${{ secrets.SIGNING_CERTIFICATE_P12_DATA }}
30+
SIGNING_CERTIFICATE_PASSWORD: ${{ secrets.SIGNING_CERTIFICATE_PASSWORD }}
31+
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
32+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
33+
run: |
34+
# create variables
35+
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
36+
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
37+
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
38+
39+
# import certificate and provisioning profile from secrets
40+
echo -n "$SIGNING_CERTIFICATE_P12_DATA" | base64 --decode --output $CERTIFICATE_PATH
41+
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
42+
43+
# create temporary keychain
44+
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
45+
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
46+
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
47+
48+
# import certificate to keychain
49+
security import $CERTIFICATE_PATH -P $SIGNING_CERTIFICATE_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
50+
security list-keychain -d user -s $KEYCHAIN_PATH
51+
52+
# apply provisioning profile
53+
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
54+
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
55+
ls ~/Library/MobileDevice/Provisioning\ Profiles/
56+
cat $CERTIFICATE_PATH | base64
57+
flutter pub get
58+
flutter build ipa
59+
brew install tree
60+
cd /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/archive/
61+
tree
62+
ls -al
63+
# xcodebuild -exportArchive -archivePath ./Runner.xcarchive -exportOptionsPlist /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/ios/exportOptions.plist -exportPath "./" -allowProvisioningUpdates
64+
cd ..
65+
tar -zcvf archive/ios.tar.gz archive
66+
67+
68+
- name: Upload binaries to release
69+
uses: svenstaro/upload-release-action@v2
70+
with:
71+
repo_token: ${{ secrets.GITHUB_TOKEN }}
72+
file: /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/archive/*
73+
tag: ${{ github.ref }}
74+
overwrite: true
75+
file_glob: true

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Upload binaries to release
2929
uses: svenstaro/upload-release-action@v2
3030
with:
31-
repo_token: ${{ secrets.GITHUBTOKEN }}
31+
repo_token: ${{ secrets.GITHUB_TOKEN }}
3232
file: build/app/outputs/flutter-apk/*
3333
tag: ${{ github.ref }}
3434
overwrite: true
@@ -55,7 +55,7 @@ jobs:
5555
- name: Upload binaries to release
5656
uses: svenstaro/upload-release-action@v2
5757
with:
58-
repo_token: ${{ secrets.GITHUBTOKEN }}
58+
repo_token: ${{ secrets.GITHUB_TOKEN }}
5959
file: /Users/runner/work/flutter-ble-terminal/flutter-ble-terminal/build/ios/iphoneos/*
6060
tag: ${{ github.ref }}
6161
overwrite: true

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ android {
3434

3535
defaultConfig {
3636
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
37-
applicationId "io.treehouses.remoteii"
37+
applicationId "treehouses.remoteii"
3838
minSdkVersion 19
3939
targetSdkVersion 31
4040
versionCode flutterVersionCode.toInteger()

ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ SPEC CHECKSUMS:
5151
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
5252
flutter_blue: eeb381dc4727a0954dede73515f683865494b370
5353
package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62
54-
path_provider: d1e9807085df1f9cc9318206cd649dc0b76be3de
54+
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
5555
permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0
5656
Protobuf: 176220c526ad8bd09ab1fb40a978eac3fef665f7
57-
shared_preferences: 5033afbb22d372e15aff8ff766df9021b845f273
58-
url_launcher: b6e016d912f04be9f5bf6e8e82dc599b7ba59649
57+
shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d
58+
url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef
5959

6060
PODFILE CHECKSUM: d4807ef77006891d298ba2f893031d4f0cd35075
6161

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
97C146E61CF9000F007C117D /* Project object */ = {
156156
isa = PBXProject;
157157
attributes = {
158-
LastUpgradeCheck = 1020;
158+
LastUpgradeCheck = 1300;
159159
ORGANIZATIONNAME = "";
160160
TargetAttributes = {
161161
97C146ED1CF9000F007C117D = {
@@ -354,16 +354,20 @@
354354
buildSettings = {
355355
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356356
CLANG_ENABLE_MODULES = YES;
357+
CODE_SIGN_IDENTITY = "Apple Development";
358+
CODE_SIGN_STYLE = Automatic;
357359
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
360+
DEVELOPMENT_TEAM = M62639WUL7;
358361
ENABLE_BITCODE = NO;
359362
INFOPLIST_FILE = Runner/Info.plist;
360363
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
361364
LD_RUNPATH_SEARCH_PATHS = (
362365
"$(inherited)",
363366
"@executable_path/Frameworks",
364367
);
365-
PRODUCT_BUNDLE_IDENTIFIER = io.treehouses.remoteii;
368+
PRODUCT_BUNDLE_IDENTIFIER = treehouses.remoteii;
366369
PRODUCT_NAME = "$(TARGET_NAME)";
370+
PROVISIONING_PROFILE_SPECIFIER = "";
367371
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
368372
SWIFT_VERSION = 5.0;
369373
VERSIONING_SYSTEM = "apple-generic";
@@ -483,16 +487,20 @@
483487
buildSettings = {
484488
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
485489
CLANG_ENABLE_MODULES = YES;
490+
CODE_SIGN_IDENTITY = "Apple Development";
491+
CODE_SIGN_STYLE = Automatic;
486492
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
493+
DEVELOPMENT_TEAM = M62639WUL7;
487494
ENABLE_BITCODE = NO;
488495
INFOPLIST_FILE = Runner/Info.plist;
489496
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
490497
LD_RUNPATH_SEARCH_PATHS = (
491498
"$(inherited)",
492499
"@executable_path/Frameworks",
493500
);
494-
PRODUCT_BUNDLE_IDENTIFIER = io.treehouses.remoteii;
501+
PRODUCT_BUNDLE_IDENTIFIER = treehouses.remoteii;
495502
PRODUCT_NAME = "$(TARGET_NAME)";
503+
PROVISIONING_PROFILE_SPECIFIER = "";
496504
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
497505
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
498506
SWIFT_VERSION = 5.0;
@@ -506,16 +514,20 @@
506514
buildSettings = {
507515
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
508516
CLANG_ENABLE_MODULES = YES;
517+
CODE_SIGN_IDENTITY = "Apple Development";
518+
CODE_SIGN_STYLE = Automatic;
509519
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
520+
DEVELOPMENT_TEAM = M62639WUL7;
510521
ENABLE_BITCODE = NO;
511522
INFOPLIST_FILE = Runner/Info.plist;
512523
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
513524
LD_RUNPATH_SEARCH_PATHS = (
514525
"$(inherited)",
515526
"@executable_path/Frameworks",
516527
);
517-
PRODUCT_BUNDLE_IDENTIFIER = io.treehouses.remoteii;
528+
PRODUCT_BUNDLE_IDENTIFIER = treehouses.remoteii;
518529
PRODUCT_NAME = "$(TARGET_NAME)";
530+
PROVISIONING_PROFILE_SPECIFIER = "";
519531
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
520532
SWIFT_VERSION = 5.0;
521533
VERSIONING_SYSTEM = "apple-generic";

ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

ios/Runner/Info.plist

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,16 @@
2222
<string>$(FLUTTER_BUILD_NUMBER)</string>
2323
<key>LSRequiresIPhoneOS</key>
2424
<true/>
25+
<key>NSBluetoothAlwaysUsageDescription</key>
26+
<string>Need BLE permission</string>
27+
<key>NSBluetoothPeripheralUsageDescription</key>
28+
<string>Need BLE permission</string>
29+
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
30+
<string>Need Location permission</string>
31+
<key>NSLocationAlwaysUsageDescription</key>
32+
<string>Need Location permission</string>
33+
<key>NSLocationWhenInUseUsageDescription</key>
34+
<string>Need Location permission</string>
2535
<key>UILaunchStoryboardName</key>
2636
<string>LaunchScreen</string>
2737
<key>UIMainStoryboardFile</key>
@@ -41,15 +51,5 @@
4151
</array>
4252
<key>UIViewControllerBasedStatusBarAppearance</key>
4353
<false/>
44-
<key>NSBluetoothAlwaysUsageDescription</key>
45-
<string>Need BLE permission</string>
46-
<key>NSBluetoothPeripheralUsageDescription</key>
47-
<string>Need BLE permission</string>
48-
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
49-
<string>Need Location permission</string>
50-
<key>NSLocationAlwaysUsageDescription</key>
51-
<string>Need Location permission</string>
52-
<key>NSLocationWhenInUseUsageDescription</key>
53-
<string>Need Location permission</string>
5454
</dict>
5555
</plist>

ios/exportOptions.plist

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>method</key>
6+
<string>ad-hoc</string>
7+
<key>teamID</key>
8+
<string>M62639WUL7</string>
9+
</dict>
10+
</plist>

pubspec.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ packages:
2121
name: async
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "2.8.1"
24+
version: "2.8.2"
2525
bloc:
2626
dependency: "direct main"
2727
description:
@@ -42,7 +42,7 @@ packages:
4242
name: characters
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "1.1.0"
45+
version: "1.2.0"
4646
charcode:
4747
dependency: transitive
4848
description:
@@ -195,14 +195,14 @@ packages:
195195
name: freezed_annotation
196196
url: "https://pub.dartlang.org"
197197
source: hosted
198-
version: "0.14.3"
198+
version: "0.14.2"
199199
http:
200200
dependency: "direct main"
201201
description:
202202
name: http
203203
url: "https://pub.dartlang.org"
204204
source: hosted
205-
version: "0.13.4"
205+
version: "0.13.3"
206206
http_parser:
207207
dependency: transitive
208208
description:
@@ -237,7 +237,7 @@ packages:
237237
name: json_annotation
238238
url: "https://pub.dartlang.org"
239239
source: hosted
240-
version: "4.3.0"
240+
version: "4.0.1"
241241
logger:
242242
dependency: "direct main"
243243
description:
@@ -251,7 +251,7 @@ packages:
251251
name: matcher
252252
url: "https://pub.dartlang.org"
253253
source: hosted
254-
version: "0.12.10"
254+
version: "0.12.11"
255255
meta:
256256
dependency: transitive
257257
description:
@@ -300,7 +300,7 @@ packages:
300300
name: path_provider
301301
url: "https://pub.dartlang.org"
302302
source: hosted
303-
version: "2.0.6"
303+
version: "2.0.4"
304304
path_provider_linux:
305305
dependency: transitive
306306
description:
@@ -342,7 +342,7 @@ packages:
342342
name: permission_handler
343343
url: "https://pub.dartlang.org"
344344
source: hosted
345-
version: "8.2.6"
345+
version: "8.3.0"
346346
permission_handler_platform_interface:
347347
dependency: transitive
348348
description:
@@ -356,7 +356,7 @@ packages:
356356
name: petitparser
357357
url: "https://pub.dartlang.org"
358358
source: hosted
359-
version: "4.4.0"
359+
version: "4.1.0"
360360
platform:
361361
dependency: transitive
362362
description:
@@ -377,7 +377,7 @@ packages:
377377
name: process
378378
url: "https://pub.dartlang.org"
379379
source: hosted
380-
version: "4.2.4"
380+
version: "4.2.3"
381381
protobuf:
382382
dependency: transitive
383383
description:
@@ -405,7 +405,7 @@ packages:
405405
name: shared_preferences
406406
url: "https://pub.dartlang.org"
407407
source: hosted
408-
version: "2.0.8"
408+
version: "2.0.7"
409409
shared_preferences_linux:
410410
dependency: transitive
411411
description:
@@ -487,7 +487,7 @@ packages:
487487
name: test_api
488488
url: "https://pub.dartlang.org"
489489
source: hosted
490-
version: "0.4.2"
490+
version: "0.4.3"
491491
typed_data:
492492
dependency: transitive
493493
description:
@@ -501,7 +501,7 @@ packages:
501501
name: url_launcher
502502
url: "https://pub.dartlang.org"
503503
source: hosted
504-
version: "6.0.12"
504+
version: "6.0.10"
505505
url_launcher_linux:
506506
dependency: transitive
507507
description:
@@ -543,14 +543,14 @@ packages:
543543
name: vector_math
544544
url: "https://pub.dartlang.org"
545545
source: hosted
546-
version: "2.1.0"
546+
version: "2.1.1"
547547
win32:
548548
dependency: transitive
549549
description:
550550
name: win32
551551
url: "https://pub.dartlang.org"
552552
source: hosted
553-
version: "2.3.0"
553+
version: "2.2.10"
554554
xdg_directories:
555555
dependency: transitive
556556
description:
@@ -564,7 +564,7 @@ packages:
564564
name: xml
565565
url: "https://pub.dartlang.org"
566566
source: hosted
567-
version: "5.3.1"
567+
version: "5.1.2"
568568
yaml:
569569
dependency: transitive
570570
description:

0 commit comments

Comments
 (0)