Skip to content

Commit 1fb1d26

Browse files
committed
get architecture from input
1 parent 7f3b53e commit 1fb1d26

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/build-collector.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,37 @@ name: "Manual Build (Collector)"
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
architecture:
7+
type: choice
8+
description: Architecture
9+
options:
10+
- all
11+
- amd64
12+
- arm64
13+
default: all
514

615
jobs:
16+
include-jobs:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
jobs: ${{ steps.include-jobs.outputs.jobs }}
20+
steps:
21+
- id: include-jobs
22+
name: Include jobs
23+
run: |
24+
includeJobs='
25+
${{ github.event.inputs.architecture == 'all' && '[{"architecture": "amd64"}, {"architecture": "arm64"}]' || '' }}
26+
${{ github.event.inputs.architecture == 'amd64' && '[{"architecture": "amd64"}]' || '' }}
27+
${{ github.event.inputs.architecture == 'arm64' && '[{"architecture": "arm64"}]' || '' }}
28+
'
29+
echo "jobs=${includeJobs}" | tr -d '[:space:]' >> $GITHUB_OUTPUT
730
build:
31+
needs: include-jobs
832
runs-on: ubuntu-latest
933
strategy:
1034
matrix:
11-
architecture: [ amd64, arm64 ]
35+
include: ${{ fromJSON(needs.include-jobs.outputs.jobs) }}
1236
outputs:
1337
COLLECTOR_VERSION: ${{ steps.save-collector-version.outputs.COLLECTOR_VERSION }}
1438
steps:

0 commit comments

Comments
 (0)