ci(release): don't patch MSR anymore, add npm semantic release plugin

This commit is contained in:
PalmDevs
2024-07-22 22:40:56 +07:00
parent 3ad0f7b19d
commit b76e223f07
6 changed files with 36 additions and 29 deletions

View File

@@ -0,0 +1,75 @@
// @ts-check
/**
* @type {import('semantic-release').Options}
*/
const Options = {
branches: [
'main',
{
name: 'dev',
prerelease: true,
},
],
plugins:
process.env['RELEASE_WORKFLOW_STEP'] !== 'publish'
? [
[
'@semantic-release/commit-analyzer',
{
releaseRules: [{ type: 'build', scope: 'Needs bump', release: 'patch' }],
},
],
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
[
'@semantic-release/npm',
{
npmPublish: false,
}
],
[
'@semantic-release/git',
{
assets: ['CHANGELOG.md', 'package.json'],
},
],
[
'@semantic-release/github',
{
assets: [
{
path: 'dist/*',
},
],
successComment: false,
},
],
// This unfortunately has to run multiple times, even though it needs to run only once.
[
'@saithodev/semantic-release-backmerge',
{
backmergeBranches: [
{
from: 'main',
to: 'dev',
},
],
clearWorkspace: true,
},
],
]
: [],
}
/**
* @param {import('semantic-release').Options} subprojectOptions
* @returns {import('semantic-release').Options}
*/
export default function defineSubprojectReleaseConfig(subprojectOptions) {
return {
...Options,
...subprojectOptions,
plugins: [...(subprojectOptions.plugins || []), ...(Options.plugins || [])],
}
}