Skip to content

Commit

Permalink
auto sign binaries (macos) (#391)
Browse files Browse the repository at this point in the history
* Use find tool to find binaries that need signing

* Check if binary is indeed signed before
  • Loading branch information
younglim authored Aug 13, 2024
1 parent 2eddcdf commit 11b6c52
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,30 @@ jobs:
- name: Install Purple dependencies for MacOS
run: |
./install_purple_dependencies.command
- name: Sign required binaries for MacOS
run: |
# Find a valid signing certificate in your keychain
CERTIFICATE=$(security find-identity -v -p codesigning -s - | tail -n +2 | grep -o '"[^"]*"' | sed 's/"//g')
# Paths to the binaries you want to sign
BINARIES=($(find . -type f -perm +111 ! -path "*.framework/*" ! -path "*.dSYM/*"))
# Loop through the binary paths and sign each one with a secure timestamp
for binary in "${BINARIES[@]}"; do
# Check if the binary is already signed
if codesign -v "$binary" &>/dev/null; then
echo "Already signed: $binary"
else
codesign --timestamp -s "$CERTIFICATE" "$binary"
if [ $? -eq 0 ]; then
echo "Successfully signed (with secure timestamp): $binary"
else
echo "Failed to sign: $binary"
fi
fi
done

- name: Zip entire Purple folder (Mac)
run: |
zip purple-a11y-portable-mac.zip -y -r ./
Expand Down

0 comments on commit 11b6c52

Please sign in to comment.