-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-ios.jsx
108 lines (88 loc) · 3.3 KB
/
build-ios.jsx
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
import { invoke, Batch, Run} from "@neurospeech/jex/index.js";
import { FileSystem } from "@neurospeech/jex/dist/utils/FileSystem.js";
import { AppleDev } from "@neurospeech/jex/dist/ci/mac/AppleDev.js";
import { Build } from "@neurospeech/jex/dist/ci/build/Build.js";
import { XCRun } from "@neurospeech/jex/dist/ci/mac/XCRun.js";
import assert from "assert";
import configs from "./build-ios.config.js";
let applicationDisplayVersion;
let applicationVersion;
const keyChainPath= "./kc1.db";
let signingIdentity;
let provisioningProfile;
for (const config of configs) {
if (!config) {
continue;
}
await invoke(<Batch
cleanup={<Batch>
<AppleDev.Clear
keyChainPath={keyChainPath}
provisioningProfile={config.provisioningProfileFile}
/>
</Batch>}
>
<FileSystem.MergeJson
json={({
App: {
Url: config.url
}
})}
path="./maui/PositronApp/appsettings.json"
/>
<Build.PrepareVersion
mode={config.buildNumber}
then={(x) => (applicationDisplayVersion = `${x.major}.${x.minor}`, applicationVersion = x.build)}
/>
{ assert(applicationDisplayVersion) }
{ assert(applicationVersion) }
<AppleDev.InstallCert
certPath={config.certPath}
certPass={config.certPass}
keyChainPath={keyChainPath}
keyChainPass=""
provisioningProfile={config.provisioningProfileFile}
then={(r) => (signingIdentity = r.friendlyName, provisioningProfile = r.pp.name)}
/>
{ console.log(`Using identity ${signingIdentity}`)}
{ console.log(`Using profile ${provisioningProfile}`)}
{/* <Run
cmd="dotnet"
args="nuget locals all --clear"
/> */}
<Run
cmd="dotnet"
timeout={300000}
args="workload install maui"
/>
<Run
cmd="dotnet"
timeout={300000}
args="workload install android ios"
/>
<Run
cmd="dotnet"
timeout={600000}
logData={true}
args={["publish",
"-f", "net8.0-ios",
"-c", "Release",
"/p:BuildIpa=true",
"/p:RuntimeIdentifier=ios-arm64",
`/p:ApplicationId=${config.id}`,
`/p:ApplicationVersion=${applicationVersion}`,
`/p:ApplicationDisplayVersion=${applicationDisplayVersion}`,
`/p:CodesignKey=${signingIdentity}`,
`/p:CodesignProvision=${provisioningProfile}`,
"./maui/PositronApp/PositronApp.csproj"]}
/>
<XCRun.UploadApp
timeout={600000}
appPath="./maui/PositronApp/bin/Release/net8.0-ios/ios-arm64/publish/PositronApp.ipa"
appType="ios"
apiKeyId={config.appStoreConnect.apiKeyId}
issuerId={config.appStoreConnect.issuerId}
apiPrivateKey={config.appStoreConnect.privateKey}
/>
</Batch>);
}