mirror of
https://github.com/cycjimmy/semantic-release-action.git
synced 2025-11-07 10:46:56 +00:00
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
const core = require('@actions/core');
|
|
const {
|
|
handleBranchesOption,
|
|
handleDryRunOption,
|
|
handleCiOption,
|
|
handleExtends,
|
|
handleTagFormat,
|
|
} = 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()
|
|
});
|
|
|
|
await cleanupNpmrc();
|
|
await windUpJob(result);
|
|
};
|
|
|
|
module.exports = () => {
|
|
core.debug('Initialization successful');
|
|
release().catch(core.setFailed);
|
|
};
|