-
Notifications
You must be signed in to change notification settings - Fork 365
142 lines (122 loc) · 5.09 KB
/
release-ios.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
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
138
139
140
141
142
name: release-ios
on:
workflow_run:
workflows:
- daily-build
types:
- completed
workflow_dispatch:
inputs:
is-split-bundle:
description: "Should it run as split-bundle? (keep it null if you don't need it)"
required: false
default: ''
jobs:
release-ios:
runs-on: ubuntu-latest
if: ${{ !github.event.workflow_run || (github.event.workflow_run && github.event.workflow_run.conclusion == 'success') }}
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x
registry-url: 'https://npm.pkg.github.com'
always-auth: true
scope: '@onekeyhq'
- name: Setup keys secret
run: |
echo ${{ secrets.GOOGLE_SERVICE_IOS }} | base64 -d > apps/mobile/ios/OneKeyWallet/GoogleService-Info.plist
echo ${{ secrets.ASC_API_KEY }} | base64 -d > apps/mobile/AscApiKey.p8
- name: Setup Expo
uses: OneKeyHQ/actions/expo-server@main
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: Setup Credentials
run: |
mkdir apps/mobile/ios/certs
echo ${{ secrets.CREDENTIALS_JSON }} | base64 -d > apps/mobile/credentials.json
echo ${{ secrets.DIST_CERT_P12 }} | base64 -d > apps/mobile/ios/certs/dist.p12
echo ${{ secrets.ADHOC_PROFILE }} | base64 -d > apps/mobile/ios/certs/profile.mobileprovision
echo ${{ secrets.ADHOC_SERVICE_EXTENSION_PROFILE }} | base64 -d > apps/mobile/ios/certs/serviceextension-profile.mobileprovision
- name: Setup ENV BUILD_NUMBER to 1
if: ${{ !github.event.workflow_run }}
run: |
# Generate build number ------- start
echo "BUILD_NUMBER=1" >> $GITHUB_ENV
# Generate build number ------- end
- name: Setup ENV BUILD_NUMBER by workflow_run
if: ${{ github.event.workflow_run }}
run: |
echo "ActionTriggerBy = ${{ github.event.action }} / ${{ github.event_name }}"
# Generate build number ------- start
DATE=`date "+%Y%m%d"`
run_number=$(($workflow_run_number % 100))
run_number=$(printf "%02d" $run_number)
build_number="${DATE}${run_number}"
echo '$build_number='$build_number
echo "BUILD_NUMBER=$build_number" >> $GITHUB_ENV
# Generate build number ------- end
env:
workflow_run_number: ${{ github.event.workflow_run.run_number}}
- name: Dotenv Action
id: dotenv
uses: OneKeyHQ/actions/dotenv-action@main
with:
path: .env.version
- name: Modify OneKeyWallet info.plist
uses: OneKeyHQ/actions/build-plist-edit@main
with:
buildNumber: ${{ env.BUILD_NUMBER }}
versionName: ${{ steps.dotenv.outputs.version }}
projectName: OneKeyWallet
dir: ./apps/mobile
- name: Modify ServiceExtension info.plist
uses: OneKeyHQ/actions/build-plist-edit@main
with:
buildNumber: ${{ env.BUILD_NUMBER }}
versionName: ${{ steps.dotenv.outputs.version }}
projectName: ServiceExtension
dir: ./apps/mobile
- name: Write .env.version
run: |
# pass BUILD_NUMBER as env variable to expo server
echo "BUILD_NUMBER=${{ env.BUILD_NUMBER }}" >> .env.version
- name: Inject Environment Variables
env:
COVALENT_KEY: ${{ secrets.COVALENT_KEY }}
GITHUB_SHA: ${{ github.sha }}
SENTRY_TOKEN: ${{ secrets.SENTRY_TOKEN }}
run: |
echo "COVALENT_KEY=${{ env.COVALENT_KEY }}" >> .env.expo
echo "GITHUB_SHA=${{ env.GITHUB_SHA }}" >> .env.expo
echo "SPLIT_BUNDLE=${{ inputs.is-split-bundle }}" >> .env.expo
echo "NO_FLIPPER=1" >> .env.expo
echo "SENTRY_DISABLE_AUTO_UPLOAD=false" >> .env.expo
echo "SENTRY_AUTH_TOKEN=${{ env.SENTRY_TOKEN }}" >> .env.expo
- name: Write .sentry.properties
run: |
echo "auth.token=${{ secrets.SENTRY_TOKEN }}" >> apps/mobile/ios/sentry.properties
- name: Install Dep
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: '--max_old_space_size=8192'
run: |
yarn
- name: Build on EAS And Auto Submit
if: ${{ github.event.workflow_run }}
run: |
cd apps/mobile
# eas build --profile=production --platform ios --non-interactive --no-wait
# replace APP STORE provision
echo ${{ secrets.APPSTORE_PROFILE }} | base64 -d > ./ios/certs/profile.mobileprovision
echo ${{ secrets.APPSTORE_SERVICE_EXTENSION_PROFILE }} | base64 -d > ./ios/certs/serviceextension-profile.mobileprovision
eas build --profile=production-store --platform ios --non-interactive --no-wait --auto-submit
- name: Build on EAS
if: ${{ !github.event.workflow_run }}
run: |
cd apps/mobile
eas build --profile=production --platform ios --non-interactive --no-wait