Skip to content

Commit

Permalink
document creation of mac sign machine
Browse files Browse the repository at this point in the history
  • Loading branch information
OriHoch committed Sep 22, 2022
1 parent 7b071d6 commit 814b7c7
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
58 changes: 58 additions & 0 deletions MAC_SIGN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Signing the binary for Mac

Following procedure should be used to allow signing the binary for Mac

* create an AWS dedicated host type mac1.metal
* create an AWS instance:
* macOS Monterey 12.5.1 AMI built by Amazon Web Services
* mac1.metal
* 100GB storage
* Tenancy: dedicated host
* target host by Host ID: the one you created above
* SSH to the instance using the key you selected and username ec2-user
* enable access via vnc:
```
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
-activate -configure -access -on \
-configure -allowAccessFor -specifiedUsers \
-configure -users ec2-user \
-configure -restart -agent -privs -all
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \
-configure -access -on -privs -all -users ec2-user
sudo passwd ec2-user
```
* login to the machine using VNC with username ec2-user and the password you set above
* login to the mac os using the same password
* Acquiring a Developer ID Certificate
* login to https://developer.apple.com
* Navigate to the certificates page.
* Click the “+” icon, select “Developer ID Application” and follow the steps.
* Download the certificate so it's available on the mac instance
* in the mac instance VNC double-click the certificate to import it into your keychain
* To verify you did this correctly, you can inspect your keychain:
```
$ security find-identity -v
1) 4194587FE60D93D416CF3F4669FF913C7BBA4271 "Developer ID Application: Your Name (GK80BB2A7)"
1 valid identities found
```
* SSH to the mac instance and create the following file at the home directory `gon-config.json`:
```
{
"source" : ["./cloudcli"],
"bundle_id" : "com.kamatera.cloudcli",
"apple_id": {
"username": "@env:AC_USERNAME",
"password": "@env:AC_PASSWORD"
},
"sign" :{
"application_identity" : "4194587FE60D93D416CF3F4669FF913C7BBA4271"
},
"dmg" :{
"output_path": "./cloudcli.dmg",
"volume_name": "cloudcli"
},
"zip" :{
"output_path" : "./cloudcli.zip"
}
}
```
4 changes: 3 additions & 1 deletion bin/build_publish_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
# export BUILD_ENV_DOCKER_IMAGE_TAG=latest
# export PUBLISH_BINARIES_VERSION=v0.0.0
# export CLOUDCLI_BUILD_ENVIRONMENT_SKIP_DOCKER_PUSH=true
# following env vars are needed to sign the mac binary via the mac VM:

# To sign mac binaries follow the guide at /MAC_SIGN.md
# you need the following env vars are needed to sign the mac binary via the mac VM:
# export AWS_ACCESS_KEY_ID=
# export AWS_SECRET_ACCESS_KEY=
# export AWS_REGION=eu-central-1
Expand Down

0 comments on commit 814b7c7

Please sign in to comment.