From 3562c66159b441c8b3d11c30157f20c7c5390a9b Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Thu, 26 Mar 2020 11:06:08 +0100 Subject: [PATCH] main: create tarball --- main.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index a6602a7..3f3d966 100644 --- a/main.js +++ b/main.js @@ -13,10 +13,10 @@ async function main() { const file = path.join(directoryRunner, "debian/changelog") const changelog = await firstline(file) - const regex = /^(?.+) \((?.+)\) (?.+); (?.+)$/ + const regex = /^(?.+) \((?.+)-(?.+)\) (?.+); (?.+)$/ const match = changelog.match(regex) - const { package, version, distribution } = match.groups - const container = package + "_" + version + const { package, version, revision, distribution } = match.groups + const container = package + "_" + version + "-" + revision const image = os + ":" + distribution.replace("UNRELEASED", "unstable") core.startGroup("Create container") @@ -38,6 +38,19 @@ async function main() { ]) core.endGroup() + core.startGroup("Create tarball") + await exec.exec("docker", [ + "exec", + container, + "tar", + "--exclude-vcs", + "--exclude", "./debian", + "--transform", `s/^\./${package}-${version}/`, + "-cvzf", `../${package}_${version}.orig.tar.gz`, + "./" + ]) + core.endGroup() + core.startGroup("Update packages list") await exec.exec("docker", [ "exec",