Skip to content

Commit d48f81b

Browse files
committed
github-actionify: sign all release JARs
Even when releasing to maven.scijava.org, we should sign the JARs, because we can. This will be very useful eventually for validating that JARs in a local environment are secure.
1 parent 58ecce6 commit d48f81b

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

github-actionify.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,23 @@ EOL
248248
releaseProfile=$(grep '<releaseProfiles>' pom.xml 2>/dev/null | sed 's/[^>]*>//' | sed 's/<.*//')
249249
if [ "$releaseProfile" ]
250250
then
251-
test "$releaseProfile" = 'deploy-to-scijava' ||
252-
warn "Unknown release profile: $releaseProfile"
251+
case "$releaseProfile" in
252+
sign,deploy-to-scijava)
253+
info 'No changes needed to <releaseProfiles> property'
254+
;;
255+
deploy-to-scijava)
256+
info 'Updating <releaseProfiles> property'
257+
sed 's;\(<releaseProfiles>\).*\(</releaseProfiles>\);\1sign,deploy-to-scijava\2;' pom.xml >"$tmpFile"
258+
update pom.xml 'sign JARs when deploying releases'
259+
;;
260+
*)
261+
warn "Unknown release profile: $releaseProfile"
262+
;;
263+
esac
253264
else
254265
info 'Adding <releaseProfiles> property'
255266
cp pom.xml "$tmpFile"
256-
perl -0777 -i -pe 's/(\n\t<\/properties>\n)/\n\n\t\t<!-- NB: Deploy releases to the SciJava Maven repository. -->\n\t\t<releaseProfiles>deploy-to-scijava<\/releaseProfiles>\1/igs' "$tmpFile"
267+
perl -0777 -i -pe 's/(\n\t<\/properties>\n)/\n\n\t\t<!-- NB: Deploy releases to the SciJava Maven repository. -->\n\t\t<releaseProfiles>sign,deploy-to-scijava<\/releaseProfiles>\1/igs' "$tmpFile"
257268
update pom.xml 'deploy releases to the SciJava repository'
258269
fi
259270

0 commit comments

Comments
 (0)