fix(ci): keep Verdaccio staging mutable
CI / build (pull_request) Successful in 34s

Replace an existing prerelease before publishing the refreshed candidate. Verdaccio remains mutable for validation while npmjs release versions stay immutable.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-08-02 22:42:39 -05:00
1 parent 29aafde84c
commit 9398a5a2df
4 files changed
+6 -48

No files matched your search

-19
View File
@@ -1,19 +0,0 @@
import { describe, expect, it } from 'vitest';
import { decideStagingPublish } from '../scripts/staging-integrity';
describe('decideStagingPublish', () => {
it('publishes a version that is not in Verdaccio', () => {
expect(decideStagingPublish('sha512-local')).toBe('publish');
});
it('skips an existing version with identical package contents', () => {
expect(decideStagingPublish('sha512-local', 'sha512-local')).toBe('skip');
});
it('rejects an existing version with different package contents', () => {
expect(() => decideStagingPublish('sha512-local', 'sha512-other')).toThrow(
'Version already exists in Verdaccio with different contents',
);
});
});
+3 -3
View File
@@ -6,12 +6,12 @@ import { describe, expect, it } from 'vitest';
const workflow = readFileSync(resolve(process.cwd(), '.github/workflows/stage.yml'), 'utf8');
describe('Verdaccio staging workflow', () => {
it('publishes immutable prereleases only from release branches', () => {
it('replaces mutable prereleases only from release branches', () => {
expect(workflow).toContain("branches: ['release/**']");
expect(workflow).toContain('npm audit');
expect(workflow).toContain('npm run prepublishOnly');
expect(workflow).toContain('scripts/staging-integrity.ts');
expect(workflow).toContain('npm unpublish');
expect(workflow).toContain('npm publish --ignore-scripts');
expect(workflow).not.toContain('npm unpublish');
expect(workflow).not.toContain('scripts/staging-integrity.ts');
});
});