Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Support for unsigned builds of the MacOS app #1803

Merged
merged 3 commits into from
Jan 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,17 @@ reload the page. For example, if your `auth=` query looks like

## Building for macOS

1. Make sure you have a working installation of Xcode 9 or higher & valid Mac Developer signing certificate
1. Make sure you have an OpenSSL ready for bottling by homebrew by running `brew install openssl --build-bottle`
1. Make sure you have `hg` installed by running `brew install hg`
1. Run `npm install nexe -g` to install the "node to native" binary tool globally
1. Open the Blockstack macOS project in Xcode and configure your code signing development team (You only need to do this once)
1. Run `npm run mac` to build a debug release signed with your Mac Developer certificate

*Note: You only need to run `nexe` once but the first build will take a while as `nexe` downloads and compiles a source copy of node. Then it creates and copies the needed proxy binaries into place and copies a built version of the browser web app into the source tree.*
1. Make sure you have a working installation of Xcode >=9 and Node.js >=10.
1. Run `npm run mac:release:dev` to build an unsigned application bundle.
1. The output bundle is located at `native/macos/export/Blockstack.app`.

*Note: This has only been tested on macOS High Sierra 10.13*

### Building a macOS release for distribution

1. Ensure you have valid Developer ID signing credentials in your Keychain. (See https://developer.apple.com/developer-id/ for more information)
1. Follow the instructions in the above section for building for macOS.
1. Open the Blockstack macOS project in Xcode and configure your code signing development team (You only need to do this once)
1. Make sure you have an OpenSSL ready for bottling by homebrew by running `brew install openssl --build-bottle`
1. Open the Blockstack macOS project in Xcode.
1. Select the Product menu and click Archive.
1. When the archive build completes, the Organizer window will open. Select your new build.
Expand Down
8 changes: 8 additions & 0 deletions native/macos/Blockstack/export_dev.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>mac-application</string>
</dict>
</plist>
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"lodash-webpack-plugin": "^0.11.5",
"mocha": "^5.2.0",
"mock-require": "^3.0.2",
"nexe": "1.1.2",
"nexe": "2.0.0-rc.34",
yknl marked this conversation as resolved.
Show resolved Hide resolved
"nock": "^9.0.13",
"node-libs-browser": "^1.0.0",
"nyc": "^13.0.1",
Expand Down Expand Up @@ -187,12 +187,16 @@
"win32:clean": "shx rm -rf build native\\windows\\BlockstackBrowser\\bin native\\windows\\BlockstackSetup\\bin native\\windows\\ProtocolHandler\\bin native\\windows\\BlockstackBrowser\\Resources\\build native\\windows\\BlockstackBrowser\\Resources\\cors-proxy native\\windows\\BlockstackBrowser\\Resources\\node_modules native\\windows\\BlockstackBrowser\\Resources\\node.exe",
"mac": "cross-env NODE_ENV=production npm run build && npm run mac:copyBrowser && npm run mac:compileCorsProxy && npm run mac:buildDebug",
"mac:release": "npm run test && npm install --no-save appdmg && npm run build && npm run mac:copyBrowser && npm run mac:compileCorsProxy && npm run mac:compileBlockstackProxy && npm run mac:release:build",
"mac:release:dev": "cross-env NODE_ENV=production npm run build && npm run mac:copyBrowser && npm run mac:compileCorsProxy && npm run mac:compileBlockstackProxy && npm run mac:release:clean && npm run mac:release:build:dev",
"mac:release:build": "npm run mac:release:build:Archive && npm run mac:release:build:Export && npm run mac:release:build:BuildDMG && npm run mac:release:build:SignDMG",
"mac:release:build:dev": "npm run mac:release:build:Archive:dev && npm run mac:release:build:Export:dev",
"mac:release:build:Archive": "xcodebuild -workspace ./native/macos/Blockstack/Blockstack.xcworkspace -scheme Blockstack -configuration Release -archivePath ./native/macos/archive/Blockstack archive",
"mac:release:build:Export": "xcodebuild -archivePath ./native/macos/archive/Blockstack.xcarchive -exportOptionsPlist ./native/macos/Blockstack/export.plist -exportArchive -exportPath ./native/macos/export/ CODE_SIGNING_REQUIRED=NO",
"mac:release:build:Export:dev": "xcodebuild -archivePath ./native/macos/archive/Blockstack.xcarchive -exportOptionsPlist ./native/macos/Blockstack/export_dev.plist -exportArchive -exportPath ./native/macos/export/ CODE_SIGNING_REQUIRED=NO",
"mac:release:build:BuildDMG": "rm -Rf ./native/macos/export/Blockstack.dmg; node ./node_modules/appdmg/bin/appdmg.js ./native/macos/dmg.json ./native/macos/export/Blockstack.dmg",
"mac:release:build:SignDMG": "codesign --force --sign \"Developer ID Application: Blockstack PBC\" ./native/macos/export/Blockstack.dmg; open ./native/macos/export/",
"mac:release:build:Archive:dev": "xcodebuild -workspace ./native/macos/Blockstack/Blockstack.xcworkspace -scheme Blockstack -configuration Release CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=\"NO\" CODE_SIGN_ENTITLEMENTS=\"\" CODE_SIGNING_ALLOWED=\"NO\" -archivePath ./native/macos/archive/Blockstack archive",
"mac:release:clean": "rm -rf ./native/macos/archive/Blockstack.xcarchive ./native/macos/export/Blockstack.app",
"mac:copyBrowser": "touch build/.gitkeep && rm -Rf native/macos/Blockstack/Blockstack/browser && mkdir -p native/macos/Blockstack/Blockstack/browser && cp -rf build/ native/macos/Blockstack/Blockstack/browser/",
"mac:compileCorsProxy": "nexe -i corsproxy/corsproxy.js -o native/macos/Blockstack/corsproxy",
"mac:compileBlockstackProxy": "nexe -i ./native/blockstackProxy.js -o ./native/macos/Blockstack/blockstackProxy",
Expand Down