ci(release): keep files and Actions runs for the last 8 releases
ci / ts / ts (packages + web) (push) Successful in 3m30s
release / android (APK в релиз) (push) Successful in 8m57s
release / release (версия и заметки) (push) Successful in 8s
release / desktop (Linux и Windows в релиз) (push) Successful in 16m4s
release / prune (старые файлы и прогоны) (push) Successful in 8s
ci / ts / ts (packages + web) (push) Successful in 3m30s
release / android (APK в релиз) (push) Successful in 8m57s
release / release (версия и заметки) (push) Successful in 8s
release / desktop (Linux и Windows в релиз) (push) Successful in 16m4s
release / prune (старые файлы и прогоны) (push) Successful in 8s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
83b604437c
commit
8eb6b36888
4 files changed
+126
-2
No files matched your search
@@ -9,6 +9,8 @@ import {
|
||||
replaceAndroidStatus,
|
||||
replaceDesktopStatus,
|
||||
desktopStatusMarks,
|
||||
staleActionRuns,
|
||||
staleReleases,
|
||||
STATUS_END,
|
||||
STATUS_START,
|
||||
} from './release.mjs';
|
||||
@@ -131,6 +133,39 @@ test('release notes', () => {
|
||||
assert.doesNotMatch(notes, /Предварительная версия/);
|
||||
});
|
||||
|
||||
test('keeps files on the newest eight releases', () => {
|
||||
const releases = Array.from({ length: 10 }, (_, i) => ({
|
||||
id: i + 1,
|
||||
tag_name: `v1.0.${i}`,
|
||||
draft: false,
|
||||
published_at: `2026-01-${String(i + 1).padStart(2, '0')}T00:00:00Z`,
|
||||
assets: i === 0 ? [] : [{ id: 100 + i, name: `a${i}.apk` }],
|
||||
}));
|
||||
const stale = staleReleases(releases, { keep: 8, currentTag: 'v1.0.9' });
|
||||
assert.deepEqual(
|
||||
stale.map((r) => r.tag_name).sort(),
|
||||
['v1.0.1'],
|
||||
);
|
||||
});
|
||||
|
||||
test('does not delete the current Actions run or unfinished jobs', () => {
|
||||
const runs = [
|
||||
{ id: 20, status: 'completed', created_at: '2026-01-20T00:00:00Z' },
|
||||
{ id: 19, status: 'in_progress', created_at: '2026-01-19T00:00:00Z' },
|
||||
...Array.from({ length: 12 }, (_, i) => ({
|
||||
id: i + 1,
|
||||
status: 'completed',
|
||||
created_at: `2026-01-${String(i + 1).padStart(2, '0')}T00:00:00Z`,
|
||||
})),
|
||||
];
|
||||
const stale = staleActionRuns(runs, { keep: 8, currentRunId: 20 });
|
||||
assert.equal(stale.some((r) => r.id === 20 || r.id === 19), false);
|
||||
assert.deepEqual(
|
||||
stale.map((r) => r.id).sort((a, b) => a - b),
|
||||
[1, 2, 3, 4],
|
||||
);
|
||||
});
|
||||
|
||||
test('release notes for a first prerelease without changes', () => {
|
||||
const notes = renderNotes({
|
||||
version: '0.1.0-rc.1',
|
||||
|
||||
Reference in new issue
Block a user