Skip to content

Commit dab3a15

Browse files
committed
chore: add action to discover goos
1 parent 67240c6 commit dab3a15

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Discover Targets"
2+
description: "Find valid GOOS targets for a distribution and FIPS configuration"
3+
inputs:
4+
distribution:
5+
description: "The distribution name"
6+
required: true
7+
fips:
8+
description: "Whether this is a FIPS build"
9+
required: true
10+
outputs:
11+
goos:
12+
description: "JSON array of valid GOOS values"
13+
value: ${{ steps.find.outputs.goos }}
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Find Valid Build Targets
18+
id: find
19+
shell: bash
20+
run: |
21+
fips_suffix=$([[ "${{ inputs.fips }}" == "true" ]] && echo "-fips" || echo "")
22+
goreleaser_file="distributions/${{ inputs.distribution }}/.goreleaser${fips_suffix}.yaml"
23+
24+
goos=$(yq -r '.builds[].goos[]' "$goreleaser_file" | sort -u | jq -R -s -c 'split("\n")[:-1]')
25+
26+
echo "Found GOOS targets: $goos"
27+
echo "goos=$goos" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)