semantic-release-config
Version:
Bundles together an ambitious semantic-release shared configuration used across many project types
91 lines • 3.21 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const defaults_1 = require("./defaults");
const github_1 = require("./github");
const project_1 = require("./project");
const semanticExec = '@semantic-release/exec';
const taskfile = (0, project_1.acquireProjectType)();
const repoType = taskfile.vars.REPOSITORY_TYPE;
const repoSubType = taskfile.vars.REPOSITORY_SUBTYPE;
const variables = (0, project_1.acquireVariables)();
const releaseRules = defaults_1.DEFAULT_RELEASE_RULES;
const assets = variables.releaseAssets ? variables.releaseAssets : defaults_1.DEFAULT_ASSETS_FILES;
const packageVariables = (0, project_1.acquirePackage)();
const { blueprint } = packageVariables;
const assetsToCommit = defaults_1.COMMIT_ASSETS;
const githubOptions = {
addReleases: 'top',
assets,
assignees: [],
failComment: false,
failTitle: false,
labels: false,
repositoryUrl: blueprint.repository.github,
successComment: (0, github_1.githubSuccessComment)(repoType, repoSubType, variables, packageVariables)
};
const npmPublish = repoType === 'npm' || blueprint.npmPublish;
const plugins = [
[
'@semantic-release/commit-analyzer',
{
config: 'conventional-changelog-emoji-config',
releaseRules
}
],
[
'@semantic-release/release-notes-generator',
{
config: 'conventional-changelog-emoji-config'
}
],
[
'@semantic-release/changelog',
{
changelogFile: 'docs/CHANGELOG.md',
changelogTitle: '# Changelog\n\nAll notable changes to this project will be documented in this file. In order to maintain ' +
'this file through automation, all commits to this repository must adhere to the guidelines laid out by ' +
'[Conventional Commits](https://conventionalcommits.org) and the ' +
'[Megabyte Labs Commit Guide](https://megabyte.space/docs/contributing/commits).'
}
],
[
'@semantic-release/npm',
{
npmPublish,
tarballDir: 'artifacts'
}
],
npmPublish ? 'semantic-release-npm-deprecate-old-versions' : [],
[
semanticExec,
{
addChannelCmd: 'task --silent release:add-channel',
analyzeCommitsCmd: 'task --silent release:analyze',
failCmd: 'task release:fail',
generateNotesCmd: 'task --silent release:notes',
prepareCmd: 'task release:prepare',
publishCmd: 'task release:publish',
successCmd: 'task release:success',
verifyConditionsCmd: 'task --silent release:verify:conditions',
verifyReleaseCmd: 'task --silent release:verify:release'
}
],
[
'@semantic-release/gitlab',
{
assets
}
],
['semantic-release-gh', githubOptions],
[
'@semantic-release/git',
{
assets: assetsToCommit,
message: 'chore(release): version ${nextRelease.version}\n\n${nextRelease.notes}'
}
]
].filter((plugin) => plugin.length);
module.exports = {
plugins
};
//# sourceMappingURL=main.js.map
;