main: create tarball

This commit is contained in:
Dawid Dziurla 2020-03-26 11:06:08 +01:00
parent 9feac88483
commit 3562c66159
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

19
main.js
View file

@ -13,10 +13,10 @@ async function main() {
const file = path.join(directoryRunner, "debian/changelog") const file = path.join(directoryRunner, "debian/changelog")
const changelog = await firstline(file) const changelog = await firstline(file)
const regex = /^(?<package>.+) \((?<version>.+)\) (?<distribution>.+); (?<options>.+)$/ const regex = /^(?<package>.+) \((?<version>.+)-(?<revision>.+)\) (?<distribution>.+); (?<options>.+)$/
const match = changelog.match(regex) const match = changelog.match(regex)
const { package, version, distribution } = match.groups const { package, version, revision, distribution } = match.groups
const container = package + "_" + version const container = package + "_" + version + "-" + revision
const image = os + ":" + distribution.replace("UNRELEASED", "unstable") const image = os + ":" + distribution.replace("UNRELEASED", "unstable")
core.startGroup("Create container") core.startGroup("Create container")
@ -38,6 +38,19 @@ async function main() {
]) ])
core.endGroup() 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") core.startGroup("Update packages list")
await exec.exec("docker", [ await exec.exec("docker", [
"exec", "exec",