Skip to content

Commit

Permalink
ci: add target list for dispatch trigger
Browse files Browse the repository at this point in the history
Allows to configure custom target lists when manually triggering a
build-run.

Signed-off-by: David Bauer <[email protected]>
  • Loading branch information
blocktrron committed Nov 27, 2023
1 parent 980a919 commit a472053
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/build-meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ DEPLOY="0"
CREATE_RELEASE="0"

# Target whitelist
TARGET_WHITELIST="$(jq -r -e '.build.targets | join(" ")' "$SCRIPT_DIR/build-info.json")"
if [ -n "$WORKFLOW_DISPATCH_TARGETS" ]; then
# Get targets from dispatch event
TARGET_WHITELIST="$WORKFLOW_DISPATCH_TARGETS"
else
# Get targets from build-info.json
TARGET_WHITELIST="$(jq -r -e '.build.targets | join(" ")' "$SCRIPT_DIR/build-info.json")"
fi

# Release Branch regex
RELEASE_BRANCH_RE="^v20[0-9]{2}\.[0-9]\.x$"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
reference:
description: 'Reference (commit / tag)'
required: true
targets:
description: 'Targets to build (space separated)'
required: true

jobs:
build-meta:
Expand Down Expand Up @@ -47,6 +50,7 @@ jobs:
env:
WORKFLOW_DISPATCH_REPOSITORY: ${{ github.event.inputs.repository }}
WORKFLOW_DISPATCH_REFERENCE: ${{ github.event.inputs.reference }}
WORKFLOW_DISPATCH_TARGETS: ${{ github.event.inputs.targets }}
runs-on: ubuntu-22.04
name: Determine build-meta
steps:
Expand Down

0 comments on commit a472053

Please sign in to comment.