diff --git a/apis/websocket/.releaserc.js b/apis/websocket/.releaserc.js index 2f2d58d..954c2cf 100644 --- a/apis/websocket/.releaserc.js +++ b/apis/websocket/.releaserc.js @@ -1,4 +1,6 @@ -export default { +import defineSubprojectReleaseConfig from '../../semantic-release-config.js' + +export default defineSubprojectReleaseConfig({ plugins: process.env.RELEASE_WORKFLOW_STEP === 'publish' ? [ @@ -27,4 +29,4 @@ export default { }, ], ], -} +}) diff --git a/bots/discord/.releaserc.js b/bots/discord/.releaserc.js index a1ed2f8..693e211 100644 --- a/bots/discord/.releaserc.js +++ b/bots/discord/.releaserc.js @@ -1,4 +1,6 @@ -export default { +import defineSubprojectReleaseConfig from '../../semantic-release-config.js' + +export default defineSubprojectReleaseConfig({ plugins: process.env.RELEASE_WORKFLOW_STEP === 'publish' ? [ @@ -27,4 +29,4 @@ export default { }, ], ], -} +}) diff --git a/bun.lockb b/bun.lockb index aa9c446..27e8610 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index c4c6c25..72440fb 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "@semantic-release/changelog": "^6.0.3", "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", - "@semantic-release/github": "^10.1.1", "@tsconfig/strictest": "^2.0.5", "@types/bun": "^1.1.6", "conventional-changelog-conventionalcommits": "^7.0.2", @@ -53,8 +52,5 @@ "@revanced/discord-bot", "esbuild", "lefthook" - ], - "patchedDependencies": { - "@anolilab/multi-semantic-release@1.1.3": "patches/@anolilab%2Fmulti-semantic-release@1.1.3.patch" - } + ] } diff --git a/patches/@anolilab%2Fmulti-semantic-release@1.1.3.patch b/patches/@anolilab%2Fmulti-semantic-release@1.1.3.patch deleted file mode 100644 index dd96e2a..0000000 --- a/patches/@anolilab%2Fmulti-semantic-release@1.1.3.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/lib/multi-semantic-release.js b/lib/multi-semantic-release.js -index 1247e618244dc35f6d60d1e484fbd1a84e504b2a..fc8dbf1c418351f2c25698e3fc3fab478693f125 100644 ---- a/lib/multi-semantic-release.js -+++ b/lib/multi-semantic-release.js -@@ -114,6 +114,11 @@ async function releasePackage(package_, createInlinePlugin, multiContext, flags) - options.ci = flags.ci === undefined ? options.ci : flags.ci; - options.branches = flags.branches ? castArray(flags.branches) : options.branches; - -+ // Patching so plugins from globalOptions are also inherited. -+ // If the third element in the array is set to true, the plugin will not be inherited. -+ options.plugins = [...(multiContext.globalOptions.plugins || []), ...(options.plugins || [])] -+ .filter(plugin => Array.isArray(plugin) ? !plugin[2] : true) -+ - // This options are needed for plugins that do not rely on `pluginOptions` and extract them independently. - options._pkgOptions = packageOptions; - diff --git a/.releaserc.js b/semantic-release-config.js similarity index 63% rename from .releaserc.js rename to semantic-release-config.js index 175fde7..7812220 100644 --- a/.releaserc.js +++ b/semantic-release-config.js @@ -1,4 +1,9 @@ -export default { +// @ts-check + +/** + * @type {import('semantic-release').Options} + */ +const Options = { branches: [ 'main', { @@ -7,7 +12,7 @@ export default { }, ], plugins: - process.env.RELEASE_WORKFLOW_STEP === 'release' + process.env['RELEASE_WORKFLOW_STEP'] !== 'publish' ? [ [ '@semantic-release/commit-analyzer', @@ -17,10 +22,16 @@ export default { ], '@semantic-release/release-notes-generator', '@semantic-release/changelog', + [ + '@semantic-release/npm', + { + npmPublish: false, + } + ], [ '@semantic-release/git', { - assets: ['README.md', 'CHANGELOG.md', 'package.json'], + assets: ['CHANGELOG.md', 'package.json'], }, ], [ @@ -34,6 +45,7 @@ export default { successComment: false, }, ], + // This unfortunately has to run multiple times, even though it needs to run only once. [ '@saithodev/semantic-release-backmerge', { @@ -45,8 +57,19 @@ export default { ], clearWorkspace: true, }, - 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 || [])], + } +}