From 88d9589a17bca0ed5d16a0444ba6e6bd0c1362b2 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Wed, 17 Jan 2024 06:10:32 +0000 Subject: [PATCH] Define the DEBs listing outside of the template Signed-off-by: Pedro Algarvio --- .../workflows/templates/build-deb-repo.yml.jinja | 13 +------------ tools/precommit/workflows.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/templates/build-deb-repo.yml.jinja b/.github/workflows/templates/build-deb-repo.yml.jinja index ac0bc159da4..4b8edb516b2 100644 --- a/.github/workflows/templates/build-deb-repo.yml.jinja +++ b/.github/workflows/templates/build-deb-repo.yml.jinja @@ -3,18 +3,7 @@ fail-fast: false matrix: include: - <%- for distro, version, arch in ( - ("debian", "10", "x86_64"), - ("debian", "10", "arm64"), - ("debian", "11", "x86_64"), - ("debian", "11", "arm64"), - ("debian", "12", "x86_64"), - ("debian", "12", "arm64"), - ("ubuntu", "20.04", "x86_64"), - ("ubuntu", "20.04", "arm64"), - ("ubuntu", "22.04", "x86_64"), - ("ubuntu", "22.04", "arm64"), - ) %> + <%- for distro, version, arch in build_debs_listing %> - pkg-type: deb distro: <{ distro }> version: "<{ version }>" diff --git a/tools/precommit/workflows.py b/tools/precommit/workflows.py index 5f3e79365df..fd304647447 100644 --- a/tools/precommit/workflows.py +++ b/tools/precommit/workflows.py @@ -263,6 +263,15 @@ def generate_workflows(ctx: Context): for arch in ("x86_64", "arm64", "aarch64"): build_rpms_listing.append((distro, release, arch)) + build_debs_listing = [] + for distro, releases in ( + ("debian", ("10", "11", "12")), + ("ubuntu", ("20.04", "22.04")), + ): + for release in releases: + for arch in ("x86_64", "arm64"): + build_debs_listing.append((distro, release, arch)) + env = Environment( block_start_string="<%", block_end_string="%>", @@ -305,6 +314,7 @@ def generate_workflows(ctx: Context): test_salt_pkg_downloads_needs_slugs ), "build_rpms_listing": build_rpms_listing, + "build_debs_listing": build_debs_listing, } shared_context = yaml.safe_load( tools.utils.SHARED_WORKFLOW_CONTEXT_FILEPATH.read_text()