import { readFileSync, statSync } from "node:fs";
export async function upload({ tarballPath, uploadUrl, deploymentId, accountName, projectName, environment, repositoryUrl, sha, }) {
    const stats = statSync(tarballPath);
    const fileSizeInBytes = stats.size;
    const bufferContent = readFileSync(tarballPath);
    const headers = new Headers({
        "Content-length": fileSizeInBytes.toString(),
        "x-goog-meta-deployment-id": deploymentId,
        "x-goog-meta-account": accountName,
        "x-goog-meta-project": projectName,
        "x-goog-meta-environment": environment,
        "x-goog-meta-repository-url": repositoryUrl ?? "",
        "x-goog-meta-sha": sha ?? "",
    });
    return fetch(uploadUrl, {
        method: "PUT",
        headers,
        body: bufferContent,
    });
}
//# sourceMappingURL=file-upload.js.map