diff --git a/.github/scripts/get-matrix.ts b/.github/scripts/get-matrix.ts index 4a408bbf00..ee2231e118 100755 --- a/.github/scripts/get-matrix.ts +++ b/.github/scripts/get-matrix.ts @@ -1,12 +1,12 @@ #!/usr/bin/env -S pkgx deno run -A -import { hooks } from "pkgx" +import { hooks, utils } from "pkgx" import { isString, isArray } from "is-what" -const project = Deno.args[0] +const pkg = utils.pkg.parse(Deno.args[0]) const rv = {} as Record -for (const platform of await get_platforms(project)) { +for (const platform of await get_platforms(pkg)) { const key = platform.replace('/', '+') rv[key] = get_matrix(platform) } @@ -23,7 +23,7 @@ if (ghout) { /////////////////////////////////////////////////////////////////////// //TODO should be in libpkgx! -async function get_platforms(pkg: string) { +async function get_platforms(pkg: {project: string}) { let { platforms } = await hooks.usePantry().project(pkg).yaml() if (!platforms) return ["linux/x86-64", "linux/aarch64", "darwin/x86-64", "darwin/aarch64"] if (isString(platforms)) platforms = [platforms]