From cf07590f11092ba453c4eea4c93abfbfeb4b6c51 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 17 Oct 2022 15:20:42 -0400 Subject: [PATCH] Fix uploads --- .github/workflows/build.yml | 2 +- scripts/build.ts | 7 ++++--- scripts/fetch.ts | 2 +- scripts/upload.ts | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 043aeac8..68c4306e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,7 +99,7 @@ jobs: - run: tar czf $GITHUB_WORKSPACE/artifacts.tgz ${{ steps.build.outputs.relative-paths }} - ${{ steps.build.outputs.srcs-actual }} + ${{ steps.build.outputs.srcs-relative-paths }} working-directory: ${{ steps.tea.outputs.prefix }} - name: upload artifacts diff --git a/scripts/build.ts b/scripts/build.ts index 363a1a00..1badd2e7 100755 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -54,11 +54,12 @@ for (const rq of dry) { } } +const to = usePrefix() await set_output("pkgs", rv.map(x => pkgutils.str(x.installation.pkg))) await set_output("paths", rv.map(x => x.installation.path), '%0A') -await set_output("relative-paths", rv.map(x => x.installation.path.relative({ to: usePrefix() }))) -await set_output("srcs", rv.map(x => x.src?.relative({ to: usePrefix() }) ?? "~")) -await set_output("srcs-actual", rv.compact(x => x.src?.relative({ to: usePrefix() }))) +await set_output("relative-paths", rv.map(x => x.installation.path.relative({ to }))) +await set_output("srcs", rv.map(x => x.src?.relative({ to }) ?? "~")) +await set_output("srcs-relative-paths", rv.compact(x => x.src?.relative({ to }))) interface InstallationPlus extends Installation { src: Path diff --git a/scripts/fetch.ts b/scripts/fetch.ts index e1074378..501e258b 100755 --- a/scripts/fetch.ts +++ b/scripts/fetch.ts @@ -24,7 +24,7 @@ const pantry = usePantry() const { download } = useDownload() export async function fetch_src(pkg: Package): Promise<[Path, Path] | undefined> { - const dstdir = useCellar().shelf(pkg.project).parent().join("src", `v${pkg.version}`) + const dstdir = useCellar().shelf(pkg.project).join("src", `v${pkg.version}`) const dist = await pantry.getDistributable(pkg) if (!dist) return const { url, stripComponents } = dist diff --git a/scripts/upload.ts b/scripts/upload.ts index 9157f22d..e1ec1466 100755 --- a/scripts/upload.ts +++ b/scripts/upload.ts @@ -12,7 +12,7 @@ args: import { S3 } from "s3" import { pkg as pkgutils } from "utils" -import { useFlags, useOffLicense, useCache } from "hooks" +import { useFlags, useOffLicense, useCache, usePrefix } from "hooks" import { Package, PackageRequirement } from "types" import SemVer, * as semver from "semver" import { dirname, basename } from "deno/path/mod.ts" @@ -82,7 +82,7 @@ for (const [index, pkg] of pkgs.entries()) { // mirror the sources if (srcs[index] != "~") { - const src = new Path(srcs[index]) + const src = usePrefix().join(srcs[index]) const srcKey = useOffLicense('s3').key({ pkg: stowed.pkg, type: "src",