fix(ci): ensure correct version calculation and git ls-remote filtering in release workflow (#12683)

This commit is contained in:
Sandy Tao
2025-11-07 13:06:55 -08:00
committed by GitHub
parent c883403147
commit f3a8b73717
3 changed files with 47 additions and 18 deletions

View File

@@ -80,7 +80,10 @@ describe('getVersion', () => {
it('should calculate the next preview version from the latest nightly', () => {
vi.mocked(execSync).mockImplementation(mockExecSync);
const result = getVersion({ type: 'preview' });
const result = getVersion({
type: 'preview',
'stable-base-version': '0.7.0',
});
expect(result.releaseVersion).toBe('0.8.0-preview.0');
expect(result.npmTag).toBe('preview');
expect(result.previousReleaseTag).toBe('v0.7.0-preview.1');
@@ -136,7 +139,10 @@ describe('getVersion', () => {
};
vi.mocked(execSync).mockImplementation(mockWithDeprecated);
const result = getVersion({ type: 'preview' });
const result = getVersion({
type: 'preview',
'stable-base-version': '0.7.0',
});
// It should base the preview off 0.8.0, not the deprecated 0.9.0
expect(result.releaseVersion).toBe('0.8.0-preview.0');
});
@@ -178,7 +184,10 @@ describe('getVersion', () => {
};
vi.mocked(execSync).mockImplementation(mockWithConflict);
const result = getVersion({ type: 'preview' });
const result = getVersion({
type: 'preview',
'stable-base-version': '0.7.0',
});
// Should have skipped preview.0 and landed on preview.1
expect(result.releaseVersion).toBe('0.8.0-preview.1');
});