-
Notifications
You must be signed in to change notification settings - Fork 98
/
Copy pathindex.js
47 lines (43 loc) · 1.33 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
const core = require('@actions/core');
const {
handleBranchesOption,
handleDryRunOption,
handleCiOption,
handleExtends,
handleTagFormat,
handleRepositoryUrlOption,
} = require('./handleOptions');
const setUpJob = require('./setUpJob.task');
const installSpecifyingVersionSemantic = require('./installSpecifyingVersionSemantic.task');
const preInstall = require('./preInstall.task');
const cleanupNpmrc = require('./cleanupNpmrc.task');
const windUpJob = require('./windUpJob.task');
const inputs = require('./inputs.json');
/**
* Release main task
* @returns {Promise<void>}
*/
const release = async () => {
if (core.getInput(inputs.working_directory)) {
process.chdir(core.getInput(inputs.working_directory));
}
await setUpJob();
await installSpecifyingVersionSemantic();
await preInstall(core.getInput(inputs.extra_plugins));
await preInstall(core.getInput(inputs.extends));
const semanticRelease = await import('semantic-release');
const result = await semanticRelease.default({
...handleBranchesOption(),
...handleDryRunOption(),
...handleCiOption(),
...handleExtends(),
...handleTagFormat(),
...handleRepositoryUrlOption()
});
await cleanupNpmrc();
await windUpJob(result);
};
module.exports = () => {
core.debug('Initialization successful');
release().catch(core.setFailed);
};