From 8f1b65a4d2a471bbd83e527627e97783b7d672ff Mon Sep 17 00:00:00 2001 From: Mike Roberts <2947595+m-roberts@users.noreply.github.com> Date: Wed, 28 Oct 2020 22:12:40 +0000 Subject: [PATCH] Move dev package list to function --- action.yml | 2 +- main.js | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/action.yml b/action.yml index 350a4f9..6c429a4 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,7 @@ inputs: required: false default: "./" target_architectures: - description: Target architecture of Debian package to build + description: Target architectures to build for required: false default: "" dpkg_buildpackage_opts: diff --git a/main.js b/main.js index 540a281..e9759ba 100644 --- a/main.js +++ b/main.js @@ -130,21 +130,26 @@ async function main() { ["apt-get", "update"] ) - args = [ - "apt-get", "install", "--no-install-recommends", "-y", - // General packaging stuff - "dpkg-dev", - "debhelper", - "lintian" - ] + function getDevPackages() { + devPackages = [ + // General packaging stuff + "dpkg-dev", + "debhelper", + "lintian" + ] - // Used by pybuild - for (targetArchitecture in targetArchitectures) { - args.concat("libpython3.7-minimal:" + targetArchitecture) + // Used by pybuild + for (targetArchitecture in targetArchitectures) { + devPackages.concat("libpython3.7-minimal:" + targetArchitecture) + } + + return devPackages } runDockerExecStep( "Install development packages", - args + [ + "apt-get", "install", "--no-install-recommends", "-y" + ].concat(getDevPackages()) ) runDockerExecStep(