mirror of
https://github.com/ivabus/pantry
synced 2024-11-23 17:05:07 +03:00
11c863706e
* Uploads artifacts to S3, bottles on a different workflow
* rip slack notifications
* be more explicit about AWS_S3_CACHE
* Revert "fix build-deps outputting stuff we need to build"
This reverts commit 972f0715f4
.
Co-authored-by: Max Howell <mxcl@me.com>
48 lines
1 KiB
TypeScript
Executable file
48 lines
1 KiB
TypeScript
Executable file
#!/usr/bin/env -S tea -E
|
|
|
|
/*---
|
|
args:
|
|
- deno
|
|
- run
|
|
- --allow-read
|
|
- --allow-env
|
|
- --import-map={{ srcroot }}/import-map.json
|
|
---*/
|
|
|
|
import { Package, PackageRequirement } from "types"
|
|
import { usePantry, useFlags } from "hooks"
|
|
import { hydrate } from "prefab"
|
|
import * as ARGV from "./utils/args.ts"
|
|
import { set_output } from "./utils/gha.ts"
|
|
import { pkg } from "utils"
|
|
|
|
const pantry = usePantry()
|
|
|
|
useFlags()
|
|
|
|
const mode: 'build' | 'install' = 'build' //Deno.args.includes("-b") ? 'build' : 'install'
|
|
|
|
const get_deps = async (pkg: Package | PackageRequirement) => {
|
|
const deps = await pantry.getDeps(pkg)
|
|
switch (mode) {
|
|
case 'build':
|
|
return [...deps.build, ...deps.runtime]
|
|
// case 'install':
|
|
// return deps.runtime
|
|
}
|
|
}
|
|
|
|
const rv: PackageRequirement[] = []
|
|
for await (const pkg of ARGV.pkgs()) {
|
|
const deps = await get_deps(pkg)
|
|
const wet = await hydrate(deps)
|
|
rv.push(...wet.pkgs)
|
|
}
|
|
|
|
const gas = rv.map(pkg.str)
|
|
|
|
if (Deno.env.get("GITHUB_ACTIONS")) {
|
|
set_output("pkgs", gas)
|
|
} else {
|
|
console.log(gas.join("\n"))
|
|
}
|