forked from yukiarrr/ios-build-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
60 lines (55 loc) · 2.35 KB
/
index.js
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
const core = require("@actions/core");
const exec = require("@actions/exec");
async function run() {
try {
// Validate p12
if (
!core.getInput("p12-base64") &&
(!core.getInput("p12-key-base64") || !core.getInput("p12-cer-base64")) &&
!core.getInput("p12-path") &&
(!core.getInput("p12-key-path") || !core.getInput("p12-cer-path"))
) {
throw new Error("P12 keys missing or in the wrong format.");
}
// Validate mobileprovision
if (
!core.getInput("mobileprovision-base64") &&
!core.getInput("mobileprovision-path")
) {
throw new Error("mobileprovision missing or in the wrong format.");
}
// Set environment variables
process.env.P12_BASE64 = core.getInput("p12-base64");
process.env.P12_KEY_BASE64 = core.getInput("p12-key-base64");
process.env.P12_CER_BASE64 = core.getInput("p12-cer-base64");
process.env.MOBILEPROVISION_BASE64 = core.getInput(
"mobileprovision-base64"
);
process.env.P12_PATH = core.getInput("p12-path");
process.env.P12_KEY_PATH = core.getInput("p12-key-path");
process.env.P12_CER_PATH = core.getInput("p12-cer-path");
process.env.MOBILEPROVISION_PATH = core.getInput("mobileprovision-path");
process.env.PROJECT_PATH = core.getInput("project-path");
process.env.CODE_SIGNING_IDENTITY = core.getInput("code-signing-identity");
process.env.TEAM_ID = core.getInput("team-id");
process.env.WORKSPACE_PATH = core.getInput("workspace-path");
process.env.EXPORT_METHOD = core.getInput("export-method");
process.env.CONFIGURATION = core.getInput("configuration");
process.env.CERTIFICATE_PASSWORD = core.getInput("certificate-password");
process.env.OUTPUT_PATH = core.getInput("output-path");
process.env.SCHEME = core.getInput("scheme");
process.env.UPDATE_TARGETS = core.getInput("update-targets");
process.env.DISABLE_TARGETS = core.getInput("disable-targets");
process.env.EXPORT_OPTIONS = core.getInput("export-options");
process.env.CLONED_SOURCE_PACKAGES_PATH = core.getInput(
"cloned-source-packages-path"
);
process.env.BUILD_SDK = core.getInput("build-sdk");
process.env.BUILD_DESTINATION = core.getInput("build-destination");
// Execute build.sh
await exec.exec(`bash ${__dirname}/../build.sh`);
} catch (error) {
core.setFailed(error.message);
}
}
run();