Version 2

* Allow selection of target architecture
* Make dpkg-buildpackage verbose
* Make apt-get verbose
* Add support for pybuild packages (via libpython3.7-minimal)
This commit is contained in:
Mike Roberts 2020-10-26 22:39:02 +00:00 committed by GitHub
commit 665b1e114c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

23
main.js
View file

@ -22,6 +22,8 @@ async function getOS(distribution) {
async function main() { async function main() {
try { try {
const targetArchitecture = core.getInput("target_architecture") || "armhf"
const sourceRelativeDirectory = core.getInput("source_directory") || "./" const sourceRelativeDirectory = core.getInput("source_directory") || "./"
const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./" const artifactsRelativeDirectory = core.getInput("artifacts_directory") || "./"
@ -98,6 +100,14 @@ async function main() {
core.endGroup() core.endGroup()
} }
core.startGroup("Add target architecture")
await exec.exec("docker", [
"exec",
container,
"dpkg", "--add-architecture", targetArchitecture
])
core.endGroup()
core.startGroup("Update packages list") core.startGroup("Update packages list")
await exec.exec("docker", [ await exec.exec("docker", [
"exec", "exec",
@ -110,7 +120,12 @@ async function main() {
await exec.exec("docker", [ await exec.exec("docker", [
"exec", "exec",
container, container,
"apt-get", "install", "--no-install-recommends", "-y", "dpkg-dev", "debhelper", "devscripts", "equivs" "apt-get", "install", "--no-install-recommends", "-y",
// General packaging stuff
"dpkg-dev",
"debhelper",
// Used by pybuild
"libpython3.7-minimal:" + targetArchitecture
]) ])
core.endGroup() core.endGroup()
@ -118,7 +133,7 @@ async function main() {
await exec.exec("docker", [ await exec.exec("docker", [
"exec", "exec",
container, container,
"mk-build-deps", "-ir", "-t", "apt-get -o Debug::pkgProblemResolver=yes -y --no-install-recommends" "apt-get", "build-dep", "-y", sourceDirectory
]) ])
core.endGroup() core.endGroup()
@ -126,7 +141,7 @@ async function main() {
await exec.exec("docker", [ await exec.exec("docker", [
"exec", "exec",
container, container,
"dpkg-buildpackage", "--no-sign", "-d", "-aarmhf" "dpkg-buildpackage", "--no-sign", "-a" + targetArchitecture
]) ])
core.endGroup() core.endGroup()
@ -137,7 +152,7 @@ async function main() {
"find", "find",
buildDirectory, buildDirectory,
"-maxdepth", "1", "-maxdepth", "1",
"-name", `${package}*${version}*.*`, "-name", `*${version}*.*`,
"-type", "f", "-type", "f",
"-print", "-print",
"-exec", "mv", "{}", artifactsDirectory, ";" "-exec", "mv", "{}", artifactsDirectory, ";"