5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-09 19:56:55 +00:00
semantic-release-action/src/index.js
cycjimmy 706c0ef960 feat(branches): support branches of semantic-release v16+
support branches of semantic-release v16+

#24 #25
2020-03-21 16:47:29 +08:00

31 lines
929 B
JavaScript

const core = require('@actions/core');
const {handleBranchesOption, handleDryRunOption} = require('./handleOptions');
const setUpJob = require('./setUpJob.task');
const installSpecifyingVersionSemantic = require('./installSpecifyingVersionSemantic.task');
const preInstallPlugins = require('./preInstallPlugins.task');
const cleanupNpmrc = require('./cleanupNpmrc.task');
const windUpJob = require('./windUpJob.task');
/**
* Release main task
* @returns {Promise<void>}
*/
const release = async () => {
await setUpJob();
await installSpecifyingVersionSemantic();
await preInstallPlugins();
const semanticRelease = require('semantic-release');
const result = await semanticRelease({
...(handleBranchesOption()),
...(handleDryRunOption()),
});
await cleanupNpmrc();
await windUpJob(result);
};
module.exports = () => {
core.debug('Initialization successful');
release().catch(core.setFailed);
};