Skip to content

Commit

Permalink
Step 16
Browse files Browse the repository at this point in the history
  • Loading branch information
vprus committed Jan 29, 2024
1 parent e874f31 commit 5ea196b
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/storage-advisor-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,31 @@ jobs:
run: |
tar -xzf storage-advisor-${{ steps.release-id.outputs.RELEASE_TAG }}-darwin-amd64.tar.gz
KEYCHAIN_NAME=\$(cat /dev/random | LC_CTYPE=C tr -dc "[:alpha:]" | head -c 16)
KEYCHAIN_PASSWORD=\$(cat /dev/random | LC_CTYPE=C tr -dc "[:alpha:]" | head -c 16)
KEYCHAIN_NAME=$(cat /dev/random | LC_CTYPE=C tr -dc "[:alpha:]" | head -c 16)
KEYCHAIN_PASSWORD=$(cat /dev/random | LC_CTYPE=C tr -dc "[:alpha:]" | head -c 16)
security create-keychain -p "\${KEYCHAIN_PASSWORD}" "\${KEYCHAIN_NAME}"
security unlock-keychain -p "\${KEYCHAIN_PASSWORD}" "\${KEYCHAIN_NAME}"
security create-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_NAME}"
security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_NAME}"
curl -O https://www.apple.com/appleca/AppleIncRootCertificate.cer
security import AppleIncRootCertificate.cer -t cert -k "\${KEYCHAIN_NAME}" -T /usr/bin/codesign -T /usr/bin/xcodebuild
security import AppleIncRootCertificate.cer -t cert -k "${KEYCHAIN_NAME}" -T /usr/bin/codesign -T /usr/bin/xcodebuild
curl -O https://www.apple.com/certificateauthority/DeveloperIDCA.cer
security import DeveloperIDCA.cer -t cert -k "\${KEYCHAIN_NAME}" -T /usr/bin/codesign -T /usr/bin/xcodebuild
security import DeveloperIDCA.cer -t cert -k "${KEYCHAIN_NAME}" -T /usr/bin/codesign -T /usr/bin/xcodebuild
rm AppleIncRootCertificate.cer DeveloperIDC
echo "$DEVELOPER_ID_APPLICATION_P12" | base64 -d > signing_cert.p12
security import signing_cert.p12 -P "$DEVELOPER_ID_APPLICATION_P12_PWD" -k "\${KEYCHAIN_NAME}" -T /usr/bin/codesign -T /usr/bin/xcodebuild
security import signing_cert.p12 -P "$DEVELOPER_ID_APPLICATION_P12_PWD" -k "${KEYCHAIN_NAME}" -T /usr/bin/codesign -T /usr/bin/xcodebuild
rm signing_cer
security set-keychain-settings \$KEYCHAIN_NAME
security set-key-partition-list -S apple-tool:,apple: -s -k "\${KEYCHAIN_PASSWORD}" "\${KEYCHAIN_N
security set-keychain-settings $KEYCHAIN_NAME
security set-key-partition-list -S apple-tool:,apple: -s -k "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_N
# we need to add our new keychain to user search list to use the certificate
keychainNames=();
for keychain in \$(security list-keychains -d user)
for keychain in $(security list-keychains -d user)
do
basename=\$(basename "\$keychain")
keychainName=\${basename::\${#basename}-4}
keychainNames+=("\$keychainName")
basename=$(basename "$keychain")
keychainName=${basename::${#basename}-4}
keychainNames+=("$keychainName")
done
security -v list-keychains -s "\${keychainNames[@]}" \$KEYCHAIN_NAME
security -v list-keychains -s "${keychainNames[@]}" $KEYCHAIN_NAME
codesign -s 98A9FF12B0FCCCEEDE752C824A2A7E189B5AEEAE -o runtime -v storage-advisor
security -v delete-keychain \$KEYCHAIN_NAME
security -v delete-keychain $KEYCHAIN_NAME

0 comments on commit 5ea196b

Please sign in to comment.