forked from VOICEVOX/voicevox_core
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* デプロイ処理を実装した onnxruntimeも一緒に出力するようにした * codesign処理追加 * /usr/bin/env に変更 * 不足していた変数定義を行った * gpu->cudaに変更した use_gpuについてもcuda制御のためのフラグだったのでuse_cudaに変更した * core.libをコピーする処理を追加 refs VOICEVOX#196 (comment) * codesign.bashに名称変更して元のscript内容と同じにした * Update .github/workflows/build_and_deploy.yml Co-authored-by: Hiroshiba <[email protected]> * linuxのcuda番のartifact_nameをgpuに変更した * onnxruntimeのコピー処理を短縮化 Co-authored-by: Hiroshiba <[email protected]>
- Loading branch information
1 parent
a6272c0
commit bdb1894
Showing
3 changed files
with
125 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# !!! コードサイニング証明書を取り扱うので取り扱い注意 !!! | ||
|
||
set -eu | ||
|
||
if [ -v "${CERT_BASE64}" ]; then | ||
echo "CERT_BASE64が未定義です" | ||
exit 1 | ||
fi | ||
if [ -v "${CERT_PASSWORD}" ]; then | ||
echo "CERT_PASSWORDが未定義です" | ||
exit 1 | ||
fi | ||
|
||
if [ $# -ne 1 ]; then | ||
echo "引数の数が一致しません" | ||
exit 1 | ||
fi | ||
target_file_glob="$1" | ||
|
||
# 証明書 | ||
CERT_PATH=cert.pfx | ||
echo -n "$CERT_BASE64" | base64 -d - > $CERT_PATH | ||
|
||
# 指定ファイルに署名する | ||
function codesign() { | ||
TARGET="$1" | ||
SIGNTOOL=$(find "C:/Program Files (x86)/Windows Kits/10/App Certification Kit" -name "signtool.exe" | sort -V | tail -n 1) | ||
powershell "& '$SIGNTOOL' sign /fd SHA256 /td SHA256 /tr http://timestamp.digicert.com /f $CERT_PATH /p $CERT_PASSWORD '$TARGET'" | ||
} | ||
|
||
# 指定ファイルが署名されているか | ||
function is_signed() { | ||
TARGET="$1" | ||
SIGNTOOL=$(find "C:/Program Files (x86)/Windows Kits/10/App Certification Kit" -name "signtool.exe" | sort -V | tail -n 1) | ||
powershell "& '$SIGNTOOL' verify /pa '$TARGET'" || return 1 | ||
} | ||
|
||
# 署名されていなければ署名 | ||
ls $target_file_glob | while read target_file; do | ||
if is_signed "$target_file"; then | ||
echo "署名済み: $target_file" | ||
else | ||
echo "署名: $target_file" | ||
codesign "$target_file" | ||
fi | ||
done | ||
|
||
# 証明書を消去 | ||
rm $CERT_PATH |