mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
* add f-droid metadata support * share version code calculation with website * preserve blockquoted sections in changelogs * refactor(android): simplify stable F-Droid metadata Generate store changelogs only for stable releases and keep native version-code ownership in the existing release module. * test(android): run F-Droid changelog suite in CI --------- Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
const {
|
|
FDROID_ABI_VERSION_CODE_SUFFIXES,
|
|
getFdroidVersionCodes,
|
|
getNativeReleaseVersion,
|
|
} = require("./native-release-version");
|
|
|
|
describe("native release version", () => {
|
|
it("reserves the final iOS build slot for a stable release", () => {
|
|
expect(getNativeReleaseVersion("0.2.6")).toEqual({
|
|
appVersion: "0.2.6",
|
|
androidVersionCode: 2006,
|
|
iosBuildNumber: "2006999",
|
|
});
|
|
});
|
|
|
|
it("gives each beta a unique iOS build slot under the stable app version", () => {
|
|
expect(getNativeReleaseVersion("0.2.6-beta.2")).toEqual({
|
|
appVersion: "0.2.6",
|
|
androidVersionCode: 2006,
|
|
iosBuildNumber: "2006002",
|
|
});
|
|
});
|
|
|
|
it("rejects beta numbers that consume the stable iOS build slot", () => {
|
|
expect(() => getNativeReleaseVersion("0.2.6-beta.999")).toThrow(
|
|
"iOS beta number must be between 1 and 998",
|
|
);
|
|
});
|
|
|
|
it("derives one F-Droid version code per published ABI", () => {
|
|
expect(FDROID_ABI_VERSION_CODE_SUFFIXES).toEqual({
|
|
"armeabi-v7a": 1,
|
|
"arm64-v8a": 2,
|
|
x86: 3,
|
|
x86_64: 4,
|
|
});
|
|
expect(getFdroidVersionCodes("0.5.0")).toEqual([
|
|
{ abi: "armeabi-v7a", versionCode: 50001 },
|
|
{ abi: "arm64-v8a", versionCode: 50002 },
|
|
{ abi: "x86", versionCode: 50003 },
|
|
{ abi: "x86_64", versionCode: 50004 },
|
|
]);
|
|
});
|
|
});
|