Skip to content

Commit 9226d71

Browse files
committed
Include npm packages in binary provenance processing
1 parent 8bc272d commit 9226d71

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ jobs:
146146
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
147147
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
148148

149+
- name: Copy npm packages into dist for provenance
150+
run: find npm -name "*.tgz" -exec cp {} dist/ \;
151+
149152
- uses: actions/upload-artifact@v7
150153
with:
151154
name: dist
@@ -155,7 +158,7 @@ jobs:
155158
- name: Prepare artifacts list
156159
id: prepare-artifacts-list
157160
run: |
158-
ARTIFACTS=$(jq '[reduce .[] as $item (
161+
GORELEASER_ARTIFACTS=$(jq '[reduce .[] as $item (
159162
[];
160163
if ($item.type == "Archive") then
161164
. + [{ template_name: ($item.goos + "-" + $item.goarch), path: $item.path }]
@@ -166,6 +169,18 @@ jobs:
166169
end
167170
)][]' dist/artifacts.json)
168171
172+
NPM_ARTIFACTS=$(find dist -maxdepth 1 -name "*.tgz" -printf '%f\n' \
173+
| jq -R '{
174+
template_name: ("npm-" + sub("-[0-9]+\\.[0-9]+\\.[0-9]+.*\\.tgz$"; "")),
175+
path: ("dist/" + .)
176+
}' \
177+
| jq -s '.')
178+
179+
ARTIFACTS=$(jq -n \
180+
--argjson g "$GORELEASER_ARTIFACTS" \
181+
--argjson n "$NPM_ARTIFACTS" \
182+
'$g + $n')
183+
169184
echo "artifacts<<nEOFn" >> $GITHUB_OUTPUT
170185
echo "${ARTIFACTS}" >> $GITHUB_OUTPUT
171186
echo "nEOFn" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)