Skip to content

Commit a58d587

Browse files
committed
feat: add package options to workflow
1 parent 6160ade commit a58d587

1 file changed

Lines changed: 71 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,83 @@ name: Build packages
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
all:
7+
description: "Build all packages (ignores checkboxes below)"
8+
type: boolean
9+
default: false
10+
wps-fonts:
11+
type: boolean
12+
default: false
13+
flydigictl:
14+
type: boolean
15+
default: false
16+
apple-fonts:
17+
type: boolean
18+
default: false
19+
claude-desktop:
20+
type: boolean
21+
default: false
22+
gpu-screen-recorder:
23+
type: boolean
24+
default: false
25+
gpu-screen-recorder-notification:
26+
type: boolean
27+
default: false
28+
gpu-screen-recorder-ui:
29+
type: boolean
30+
default: false
31+
prismlauncher-9:
32+
type: boolean
33+
default: false
34+
open-scq30:
35+
type: boolean
36+
default: false
537

638
jobs:
39+
setup:
40+
runs-on: ubuntu-latest
41+
outputs:
42+
matrix: ${{ steps.set-matrix.outputs.matrix }}
43+
steps:
44+
- id: set-matrix
45+
run: |
46+
declare -A checked=(
47+
[wps-fonts]="${{ inputs.wps-fonts }}"
48+
[flydigictl]="${{ inputs.flydigictl }}"
49+
[apple-fonts]="${{ inputs.apple-fonts }}"
50+
[claude-desktop]="${{ inputs.claude-desktop }}"
51+
[gpu-screen-recorder]="${{ inputs.gpu-screen-recorder }}"
52+
[gpu-screen-recorder-notification]="${{ inputs.gpu-screen-recorder-notification }}"
53+
[gpu-screen-recorder-ui]="${{ inputs.gpu-screen-recorder-ui }}"
54+
[prismlauncher-9]="${{ inputs.prismlauncher-9 }}"
55+
[open-scq30]="${{ inputs.open-scq30 }}"
56+
)
57+
58+
json="["
59+
first=true
60+
for pkg in "${!checked[@]}"; do
61+
if [ "${{ inputs.all }}" = "true" ] || [ "${checked[$pkg]}" = "true" ]; then
62+
if [ "$first" = false ]; then json="$json,"; fi
63+
json="$json\"$pkg\""
64+
first=false
65+
fi
66+
done
67+
json="$json]"
68+
echo "matrix=$json" >> "$GITHUB_OUTPUT"
69+
70+
- name: Fail if nothing selected
71+
run: |
72+
if [ '${{ steps.set-matrix.outputs.matrix }}' = "[]" ]; then
73+
echo "::error::No packages selected and 'all' was not checked."
74+
exit 1
75+
fi
776
build:
77+
needs: setup
878
runs-on: ubuntu-latest
979
strategy:
1080
matrix:
11-
package:
12-
- wps-fonts
13-
- flydigictl
14-
- apple-fonts
15-
- claude-desktop
16-
- gpu-screen-recorder
17-
- gpu-screen-recorder-notification
18-
- gpu-screen-recorder-ui
19-
- prismlauncher-9
20-
- open-scq30
81+
package: ${{ fromJson(needs.setup.outputs.matrix) }}
2182
max-parallel: 4
2283
fail-fast: false
2384

0 commit comments

Comments
 (0)