Attempt to account for shared deps in CI
This commit is contained in:
parent
65c5403b6f
commit
27099cca40
|
@ -32,6 +32,17 @@ export async function getSharedDeps() {
|
||||||
// the function implementation for the full list of keys.
|
// the function implementation for the full list of keys.
|
||||||
export async function getPackages() {
|
export async function getPackages() {
|
||||||
const packages = [];
|
const packages = [];
|
||||||
|
for (const dep of await getSharedDeps()) {
|
||||||
|
const type = "shared";
|
||||||
|
const name = `riju-${type}-${lang}`;
|
||||||
|
packages.push({
|
||||||
|
lang,
|
||||||
|
type,
|
||||||
|
name,
|
||||||
|
buildScriptPath: `build/${type}/${lang}/build.bash`,
|
||||||
|
debPath: `build/${type}/${lang}/${name}.deb`,
|
||||||
|
});
|
||||||
|
}
|
||||||
for (const lang of await getLangs()) {
|
for (const lang of await getLangs()) {
|
||||||
for (const type of ["lang", "config"]) {
|
for (const type of ["lang", "config"]) {
|
||||||
const name = `riju-${type}-${lang}`;
|
const name = `riju-${type}-${lang}`;
|
||||||
|
@ -44,17 +55,6 @@ export async function getPackages() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const dep of await getSharedDeps()) {
|
|
||||||
const type = "shared";
|
|
||||||
const name = `riju-${type}-${lang}`;
|
|
||||||
packages.push({
|
|
||||||
lang,
|
|
||||||
type,
|
|
||||||
name,
|
|
||||||
buildScriptPath: `build/${type}/${lang}/build.bash`,
|
|
||||||
debPath: `build/${type}/${lang}/${name}.deb`,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return packages;
|
return packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,10 +74,23 @@ async function planDebianPackages(opts) {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
const packages = await getPackages();
|
const packages = await getPackages();
|
||||||
|
const uuids = Object.fromEntries(
|
||||||
|
packages.map(({ name }) => [name, getUUID()])
|
||||||
|
);
|
||||||
const langUUIDs = Object.fromEntries(
|
const langUUIDs = Object.fromEntries(
|
||||||
packages
|
packages
|
||||||
.filter(({ type }) => type === "lang")
|
.filter(({ type }) => type === "lang")
|
||||||
.map(({ lang }) => ["lang", getUUID()])
|
.map(({ lang, name }) => [lang, uuids[name]])
|
||||||
|
);
|
||||||
|
const sharedUUIDs = Object.fromEntries(
|
||||||
|
packages
|
||||||
|
.filter(({ type }) => type === "shared")
|
||||||
|
.map(({ lang }) => [lang, uuids[name]])
|
||||||
|
);
|
||||||
|
const langConfigs = Object.fromEntries(
|
||||||
|
await Promise.all(
|
||||||
|
(await getLangs()).map(async (id) => [id, await readLangConfig(id)])
|
||||||
|
)
|
||||||
);
|
);
|
||||||
return await Promise.all(
|
return await Promise.all(
|
||||||
packages.map(async ({ lang, type, name, buildScriptPath, debPath }) => {
|
packages.map(async ({ lang, type, name, buildScriptPath, debPath }) => {
|
||||||
|
@ -101,11 +114,19 @@ async function planDebianPackages(opts) {
|
||||||
).stdout.trim() || null;
|
).stdout.trim() || null;
|
||||||
}
|
}
|
||||||
const remote = remoteHashes[name] || null;
|
const remote = remoteHashes[name] || null;
|
||||||
|
let sharedDeps = [];
|
||||||
|
if (type === "lang") {
|
||||||
|
const cfg = langConfigs[lang];
|
||||||
|
sharedDeps = ((cfg.install && cfg.install.riju) || []).map(
|
||||||
|
(id) => sharedUUIDs[id]
|
||||||
|
);
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
id: getUUID(),
|
id: uuids[name],
|
||||||
deps: [
|
deps: [
|
||||||
...(deps || []),
|
...(deps || []),
|
||||||
type === "config" ? langUUIDs[lang] : getUUID(),
|
...(type === "config" ? [langUUIDs[lang]] : []),
|
||||||
|
...sharedDeps,
|
||||||
],
|
],
|
||||||
artifact: "Debian package",
|
artifact: "Debian package",
|
||||||
name,
|
name,
|
||||||
|
|
Loading…
Reference in New Issue