Files
revanced-bots/semantic-release-config.js
2025-04-09 20:46:53 +07:00

73 lines
1.8 KiB
JavaScript

// @ts-check
/**
* @type {import('semantic-release').Options}
*/
const Options = {
branches: [
'main',
{
name: 'dev',
prerelease: true,
},
],
plugins: [
[
'@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', '../../bun.lockb'],
},
],
[
'@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: [...(Options.plugins || []), ...(subprojectOptions.plugins || [])],
}
}