fix: publish first stable release as 0.1.0 (#143)

This commit is contained in:
Andrey Avtomonov 2026-05-19 15:52:30 +02:00 committed by GitHub
parent b4c77c0563
commit 7110aa6f5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 294 additions and 7 deletions

View file

@ -35,6 +35,7 @@ describe('semantic-release config', () => {
releaseExecOptions(config).prepareCmd,
/update-public-release-version\.mjs "\$\{nextRelease\.version\}" "latest"/,
);
assert.ok(config.plugins.includes('./scripts/semantic-release-version-policy.cjs'));
});
it('rejects stable releases from non-main branches', () => {
@ -51,4 +52,16 @@ describe('semantic-release config', () => {
);
assert.match(analyzeExec[1].analyzeCommitsCmd, /FORCE_RELEASE === 'true' \? 'patch' : ''/);
});
it('does not configure any commit type to create an automatic major release', () => {
const config = createReleaseConfig({ KTX_RELEASE_KIND: 'stable', GITHUB_REF_NAME: 'main' });
const analyzer = config.plugins.find(
(plugin) => Array.isArray(plugin) && plugin[0] === '@semantic-release/commit-analyzer',
);
assert.equal(
analyzer[1].releaseRules.some((rule) => rule.release === 'major'),
false,
);
});
});