@@ -68,36 +68,53 @@ jobs:
6868 - name : Install cosign
6969 uses : sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
7070
71- - name : Locate binary
72- id : binary
71+ - name : Locate binaries
72+ id : binaries
7373 run : |
74- BINARY=$(find dist -type f -name '*darwin_unnotarized' | head -1)
75- if [ -z "$BINARY" ] || [ ! -f "$BINARY" ]; then
76- echo "::error::Binary not found"
77- find dist -type f
78- exit 1
79- fi
80- echo "path=$BINARY" >> "$GITHUB_OUTPUT"
74+ DARWIN=$(find dist -type f -name '*darwin_unnotarized' | head -1)
75+ WIN_AMD64=$(find dist -type f -name '*windows_amd64.exe' | head -1)
76+ WIN_ARM64=$(find dist -type f -name '*windows_arm64.exe' | head -1)
77+
78+ for label in "darwin:${DARWIN}" "windows_amd64:${WIN_AMD64}" "windows_arm64:${WIN_ARM64}"; do
79+ name="${label%%:*}"
80+ path="${label#*:}"
81+ if [ -z "$path" ] || [ ! -f "$path" ]; then
82+ echo "::error::Binary not found for ${name}"
83+ find dist -type f
84+ exit 1
85+ fi
86+ done
87+
88+ echo "darwin=$DARWIN" >> "$GITHUB_OUTPUT"
89+ echo "win_amd64=$WIN_AMD64" >> "$GITHUB_OUTPUT"
90+ echo "win_arm64=$WIN_ARM64" >> "$GITHUB_OUTPUT"
8191
8292 - name : Sign artifacts with Sigstore
8393 run : |
84- cosign sign-blob "${{ steps.binary.outputs.path }}" \
85- --bundle "${{ steps.binary.outputs.path }}.bundle" --yes
86- cosign sign-blob stepsecurity-dev-machine-guard.sh \
87- --bundle dist/stepsecurity-dev-machine-guard.sh.bundle --yes
94+ for artifact in \
95+ "${{ steps.binaries.outputs.darwin }}" \
96+ "${{ steps.binaries.outputs.win_amd64 }}" \
97+ "${{ steps.binaries.outputs.win_arm64 }}" \
98+ stepsecurity-dev-machine-guard.sh; do
99+ cosign sign-blob "$artifact" --bundle "${artifact}.bundle" --yes
100+ done
88101
89102 - name : Upload cosign bundles
90103 env :
91104 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
92105 run : |
93106 gh release upload "${{ steps.version.outputs.tag }}" \
94- "${{ steps.binary.outputs.path }}.bundle" \
107+ "${{ steps.binaries.outputs.darwin }}.bundle" \
108+ "${{ steps.binaries.outputs.win_amd64 }}.bundle" \
109+ "${{ steps.binaries.outputs.win_arm64 }}.bundle" \
95110 dist/stepsecurity-dev-machine-guard.sh.bundle \
96111 --clobber
97112
98113 - name : Attest build provenance
99114 uses : actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # v4.1.0
100115 with :
101116 subject-path : |
102- ${{ steps.binary.outputs.path }}
117+ ${{ steps.binaries.outputs.darwin }}
118+ ${{ steps.binaries.outputs.win_amd64 }}
119+ ${{ steps.binaries.outputs.win_arm64 }}
103120 stepsecurity-dev-machine-guard.sh
0 commit comments