-
Notifications
You must be signed in to change notification settings - Fork 7
137 lines (121 loc) · 4.36 KB
/
bmvn_build_appcenter_ios.yaml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: MacMiniM2 Deploy appcenter iOS app
on:
# Enable manual run
workflow_dispatch:
inputs:
version:
description: "App version"
required: true
message:
description: Change logs
required: false
testnet:
type: boolean
default: false
required: false
description: Using testnet (Default staging)
workflow_call:
inputs:
version:
description: "App version"
type: string
required: false
message:
description: Change logs
type: string
required: false
testnet:
type: boolean
default: false
required: false
description: Using testnet (Default staging)
jobs:
fastlane-deploy:
runs-on: [self-hosted, macOS]
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.1"
channel: stable
# - uses: maxim-lobanov/setup-xcode@v1
# with:
# xcode-version: "14.3"
- name: Set env
run: |
${{ inputs.testnet == true }} && echo FASTLAN_ENV=test >> $GITHUB_ENV || echo FASTLAN_ENV=main >> $GITHUB_ENV
# Checkout code and get packages.
- name: Checkout code
uses: actions/checkout@v3
# Setup Ruby, Bundler, and Gemfile dependencies
# - name: Setup Fastlane
# uses: ruby/setup-ruby@v1
# with:
# ruby-version: "2.6"
# bundler-cache: true
# working-directory: ios
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.KEY_VAULT_DEPLOYMENT_KEY }}
${{ secrets.SSH_ASSETS_KEY }}
- name: Create env file
run: |
touch .env
${{ inputs.testnet == true }} && echo -e "${{ secrets.DEV_ENV_VARS }}" | sed 's/\\n/\n/g' >> .env || echo -e "${{ secrets.STAGING_ENV_VARS }}" | sed 's/\\n/\n/g' >> .env
cat .env
- name: Create env secret file
run: |
touch .env.secret
${{ inputs.testnet == true }} && echo -e "${{ secrets.DEV_ENV_SECRET }}" | sed 's/\\n/\n/g' >> .env.secret || echo -e "${{ secrets.STAGING_ENV_SECRET }}" | sed 's/\\n/\n/g' >> .env.secret
cat .env.secret
- name: Flutter doctor
run: flutter doctor
- name: Submoudles update
run: git -c submodule.auto-test.update=none submodule update --init --recursive
# Precache to fix iOS pod install issue
- run: flutter precache --ios
- name: cache pods
uses: actions/cache@v1
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/ios/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: pod install
if: steps.cache-cocoapods.outputs.cache-hit != 'true'
run: |
flutter pub cache repair
flutter clean
flutter pub get
cd ios/
pod install
# Encrypt secrets before use
- name: Encrypt Secrets
run: |
./script/encrypt_secrets.sh ${{ secrets.ENTROPY }}
- uses: mathieu-bour/setup-sentry-cli@main
# Build and deploy with Fastlane (by default, to ciappcenter track) 🚀.
- name: Build and deploy with Fastlane
env:
ENTERPRISE_CERTIFICATE_PASSWORD: ${{ secrets.ENTERPRISE_CERTIFICATE_PASSWORD }}
APPSTORE_CERTIFICATE_PASSWORD: ${{ secrets.APPSTORE_CERTIFICATE_PASSWORD }}
JSON_FILE: ${{ secrets.JSON_FILE }}
SENTRY_AUTH: ${{ secrets.SENTRY_AUTH }}
APPCENTER_API_TOKEN: ${{ secrets.APPCENTER_API_TOKEN }}
APP_VERSION: ${{ inputs.version }}
BRANCH_KEY: ${{ secrets.BRANCH_KEY }}
RELEASE_NOTES: ${{ inputs.message }}
run: |
git clone [email protected]:bitmark-inc/mobile-signing-key-vault.git --depth 1
echo $JSON_FILE >> key.json
bundle exec fastlane install_plugins
echo "APP_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
bundle exec fastlane ciappcenter env:${{ env.FASTLAN_ENV }}
working-directory: ios
- name: Upload Sentry debug symbols
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH }}
run: |
flutter packages pub run sentry_dart_plugin