5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-07 10:46:56 +00:00
semantic-release-action/src/index.js
Johan Enell 0c2055456e feat: update node version on runner to 20
BREAKING CHANGE: set the default node version to 20
2023-08-24 15:09:28 +02:00

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);
};