From acb7fa176b9fecadbb534e2a66d8b4e76d91a36d Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Tue, 6 Feb 2024 09:02:57 +0100 Subject: [PATCH] github: allow manual triggering of selected distributions [skip ci] (cherry picked from commit e62bd173bda49c1d60e6c54e39d8707a19a93b92) --- .github/workflows/github-packages.yml | 7 ++++++- get-all-dist.sh | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/github-packages.yml b/.github/workflows/github-packages.yml index fec2626..7098d2b 100644 --- a/.github/workflows/github-packages.yml +++ b/.github/workflows/github-packages.yml @@ -6,6 +6,11 @@ on: - '5.*' # Allows you to run this workflow manually from the Actions tab workflow_dispatch: + inputs: + dists: + description: list of dists to build, coma separated. xenial,sid + required: false + type: string env: REGISTRY_NAME: ghcr.io IMAGE_NAME: kamailio @@ -18,7 +23,7 @@ jobs: - id: set-matrix run: | sudo apt-get install jq - echo "matrix=$(bash get-all-dist.sh)" >> $GITHUB_OUTPUT + echo "matrix=$(bash get-all-dist.sh ${{ github.event.inputs.dists }})" >> $GITHUB_OUTPUT outputs: dist: ${{ steps.set-matrix.outputs.matrix }} docker: diff --git a/get-all-dist.sh b/get-all-dist.sh index 64169ac..4f8b6cd 100755 --- a/get-all-dist.sh +++ b/get-all-dist.sh @@ -1,4 +1,8 @@ #!/bin/bash -find . -name Dockerfile -exec dirname {} \; | \ - grep -v -e 'stretch' -e 'bookworm' | \ - jq -R . | sed 's#./##g' | jq -cs . +if [ -n "${1}" ] ; then + echo "\"${1}\"" | jq -c 'split(",")' +else + find . -name Dockerfile -exec dirname {} \; | \ + grep -v -e 'stretch' | \ + jq -R . | sed 's#./##g' | jq -cs . +fi