mirror of
https://github.com/astral-sh/uv.git
synced 2026-05-06 08:56:53 -04:00
6caa08adba
Uses a nextest setup hook to sign the uv and test binaries before running the tests. This allows you to grant permission to the test suite _once_ when running native authentication tests on macOS. Otherwise, you get prompted on every access on every binary change.
37 lines
727 B
Bash
Executable File
37 lines
727 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Sign macOS binaries with a code signing identity.
|
|
#
|
|
# Usage:
|
|
#
|
|
# Sign binaries with the given identity:
|
|
#
|
|
# $ ./scripts/codesign-macos.sh <identity> <target>...
|
|
#
|
|
# For example:
|
|
#
|
|
# $ ./scripts/codesign-macos.sh "Mac Developer: Your Name (TEAM_ID)" target/debug/uv
|
|
#
|
|
# Use `security find-identity -v -p codesigning` to list available identities.
|
|
|
|
set -euo pipefail
|
|
|
|
if [[ "$(uname)" != "Darwin" ]]; then
|
|
echo "Not on macOS, skipping" >&2
|
|
exit 0
|
|
fi
|
|
|
|
if [[ $# -lt 2 ]]; then
|
|
echo "Usage: codesign-macos.sh <identity> <target>..." >&2
|
|
exit 1
|
|
fi
|
|
|
|
identity="$1"
|
|
shift
|
|
|
|
for target in "$@"; do
|
|
if [[ -f "$target" ]]; then
|
|
codesign --force --sign "$identity" "$target"
|
|
fi
|
|
done
|