Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2c09259

Browse files
committed
refactor(goreleaser): add post hook to codesign
1 parent51ed51e commit2c09259

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

‎.goreleaser.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ builds:
6969
{{- else }}{{ .Arch }}{{ end }}
7070
{{- if .Arm }}-{{ .Arm }}{{ end }}
7171
no_unique_dist_dir:true
72+
hooks:
73+
post:
74+
-cmd:./script/sign '{{ .Path }}'
75+
output:true
7276

7377
archives:
7478
-format:binary

‎script/sign

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
# usage: script/sign <file>
3+
#
4+
# Signs macOS binaries using codesign, notarizes macOS zip archives using notarytool, and signs
5+
# Windows EXE and MSI files using osslsigncode.
6+
#
7+
set -e
8+
9+
sign_macos() {
10+
if [-z"$APPLE_DEVELOPER_ID" ];then
11+
echo"skipping macOS code-signing; APPLE_DEVELOPER_ID not set">&2
12+
return 0
13+
fi
14+
15+
if [[$1==*.zip ]];then
16+
xcrun notarytool submit"$1" --apple-id"${APPLE_ID?}" --team-id"${APPLE_DEVELOPER_ID?}" --password"${APPLE_ID_PASSWORD?}"
17+
else
18+
codesign --timestamp --options=runtime -s"${APPLE_DEVELOPER_ID?}" -v"$1"
19+
fi
20+
}
21+
22+
if [$#-eq 0 ];then
23+
echo"usage: script/sign <file>">&2
24+
exit 1
25+
fi
26+
27+
platform="$(uname -s)"
28+
29+
for input_file;do
30+
case"$input_file"in
31+
*.exe |*.msi)
32+
sign_windows"$input_file"
33+
;;
34+
*)
35+
if ["$platform"="Darwin" ];then
36+
sign_macos"$input_file"
37+
else
38+
printf"warning: don't know how to sign %s on %s\n""$1","$platform">&2
39+
fi
40+
;;
41+
esac
42+
done

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp