Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup-macos-codesigning/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ runs:
: macOS Code Signing ✍️
if (( ${+RUNNER_DEBUG} )) setopt XTRACE

if [[ ${MACOS_SIGNING_IDENTITY} && ${MACOS_SIGNING_IDENTITY_INSTALLER} && ${MACOS_SIGNING_CERT} ]] {
if [[ ${MACOS_SIGNING_IDENTITY} && ${MACOS_SIGNING_CERT} ]] {
print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT

local -r certificate_path="${RUNNER_TEMP}/build_certificate.p12"
Expand Down
9 changes: 6 additions & 3 deletions .github/scripts/package-macos
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ package() {
local buildspec_file=${project_root}/buildspec.json

fpath=("${SCRIPT_HOME}/utils.zsh" ${fpath})
autoload -Uz log_group log_error log_output check_macos
autoload -Uz log_group log_error log_warning log_output check_macos

if [[ ! -r ${buildspec_file} ]] {
log_error \
Expand Down Expand Up @@ -117,19 +117,22 @@ package() {
typeset -gx CODESIGN_IDENT_INSTALLER="${CODESIGN_IDENT_INSTALLER:--}"
typeset -gx CODESIGN_TEAM="$(print "${CODESIGN_IDENT}" | /usr/bin/sed -En 's/.+\((.+)\)/\1/p')"

if (( codesign )) {
if (( codesign )) && [[ ${CODESIGN_IDENT_INSTALLER} != - ]] {
productsign \
--sign "${CODESIGN_IDENT_INSTALLER}" \
${project_root}/release/${config}/${product_name}.pkg \
${project_root}/release/${output_name}.pkg

rm ${project_root}/release/${config}/${product_name}.pkg
} else {
if (( codesign )) log_warning "No Developer ID Installer identity: the plugin is signed, the package is not."
mv ${project_root}/release/${config}/${product_name}.pkg \
${project_root}/release/${output_name}.pkg
}

if (( codesign && notarize )) {
if (( codesign && notarize )) && [[ ${CODESIGN_IDENT_INSTALLER} == - ]] {
log_warning "Skipping notarization: an unsigned package cannot be notarized."
} elif (( codesign && notarize )) {
if ! [[ ${CODESIGN_IDENT} != '-' && ${CODESIGN_TEAM} && {CODESIGN_IDENT_USER} && ${CODESIGN_IDENT_PASS} ]] {
log_error "Notarization requires Apple ID and application password."
return 2
Expand Down
Loading