mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-14 16:07:52 +00:00
Adds a nightly channel. Twice a day nightly.yml builds the newest main commit that passed CI and publishes it as a prerelease (OpenIDEA Nightly, ai.l0ng.openidea.nightly, own data and update manifest), or stops when nothing is newer than the last nightly. Platform builds move from release.yml into the reusable release-build.yml so both channels build the same way. Versions are one patch above main with a timestamp suffix; each build gets its own v…-nightly.… tag (remote development downloads the server by version) and the last 14 are kept; a rolling nightly release holds latest.json. No MSI or RPM for nightlies. Nightly builds skip the CNB mirror manifest, and their automatic update prompts (startup and periodic) appear at most once a day; a manual check always answers. Workflow permissions default to contents: read with write granted per job, Apple signing secrets reach only macOS builds, stable release.yml rejects nightly tags, tag pruning only matches -nightly. tags, and nightly runs share one concurrency group.
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
// @vitest-environment node
|
|
import { readFileSync } from "node:fs";
|
|
import { describe, expect, it } from "vitest";
|
|
import { NIGHTLY_ENDPOINT, nightlyVersion, setNightlyIdentity } from "./nightly-prepare.ts";
|
|
|
|
describe("nightlyVersion", () => {
|
|
it("is one patch above the current version, numbered by its stamp", () => {
|
|
expect(nightlyVersion("0.1.39", "202611081417")).toBe("0.1.40-nightly.202611081417");
|
|
});
|
|
|
|
it.each([undefined, "", "2026", "012611081417", "20261108141a"])("rejects the stamp %s", (stamp) => {
|
|
expect(() => nightlyVersion("0.1.39", stamp)).toThrow("stamp");
|
|
});
|
|
|
|
it("rejects a current version that is not a release version", () => {
|
|
expect(() => nightlyVersion("0.1.40-nightly.202611081417", "202611081417")).toThrow("expected a version");
|
|
});
|
|
});
|
|
|
|
describe("setNightlyIdentity", () => {
|
|
const conf = JSON.parse(setNightlyIdentity(readFileSync("src-tauri/tauri.conf.json", "utf8")));
|
|
|
|
it("is an app of its own that updates from the nightly manifest", () => {
|
|
expect(conf.productName).toBe("OpenIDEA Nightly");
|
|
expect(conf.identifier).toBe("ai.l0ng.openidea.nightly");
|
|
expect(conf.plugins.updater.endpoints).toEqual([NIGHTLY_ENDPOINT]);
|
|
});
|
|
|
|
it("leaves out the bundles that reject prerelease versions", () => {
|
|
expect(conf.bundle.targets).not.toContain("msi");
|
|
expect(conf.bundle.targets).not.toContain("rpm");
|
|
expect(conf.bundle.createUpdaterArtifacts).toBe(true);
|
|
});
|
|
});
|