-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] Add packaging scripts for each platform (#3656)
- Loading branch information
Showing
4 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
[ $(uname) = Linux ] || { | ||
echo "$0 must be run from linux" 2>&1 | ||
exit 1 | ||
} | ||
|
||
NODE_MODULES=node_modules | ||
YARNCACHE=.yarncache | ||
|
||
set -ex | ||
[ -d ${NODE_MODULES} ] && rm -rf ${NODE_MODULES} | ||
[ -d ${YARNCACHE} ] && rm -rf ${YARNCACHE} | ||
mkdir -p ${YARNCACHE} | ||
|
||
# prepare directory with package files | ||
yarn install --cache-folder ${YARNCACHE} | ||
yarn rebuild-natives | ||
yarn package-linux | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/sh | ||
|
||
# submit a package to be notarized | ||
# returns: notarization uuid | ||
notary_submit() { | ||
xcrun altool -f release/decrediton-${VERSION}.zip \ | ||
--notarize-app \ | ||
--primary-bundle-id org.Electron.Decrediton \ | ||
--asc-provider ${IDENTITY} \ | ||
-p @keychain:${KEYCHAIN} 2>&1 \ | ||
| perl -ne 'print if s/^RequestUUID = //' | ||
} | ||
|
||
# check notarization status after successful submission | ||
# arg 1: uuid | ||
# returns: altool output | ||
notary_status() { | ||
local _uuid=$1 | ||
xcrun altool --notarization-info ${_uuid} -p @keychain:${KEYCHAIN} 2>&1 | ||
} | ||
|
||
[ $(uname) = Darwin ] || { | ||
echo "$0 must be run from darwin" 2>&1 | ||
exit 1 | ||
} | ||
[ $# = 3 ] || { | ||
echo "usage: $0 version identity arch" 2>&1 | ||
exit 2 | ||
} | ||
|
||
VERSION=$1 | ||
IDENTITY=$2 | ||
ARCH=$3 | ||
KEYCHAIN=${KEYCHAIN:-signer} | ||
NODE_MODULES=node_modules | ||
YARNCACHE=.yarncache | ||
|
||
set -ex | ||
[ -d ${NODE_MODULES} ] && rm -rf ${NODE_MODULES} | ||
[ -d ${YARNCACHE} ] && rm -rf ${YARNCACHE} | ||
mkdir -p ${YARNCACHE} | ||
|
||
# prepare directory with package files | ||
yarn install --cache-folder ${YARNCACHE} | ||
yarn rebuild-natives | ||
yarn package-mac-${ARCH} | ||
|
||
# submit notarization | ||
_uuid=$(notary_submit) | ||
|
||
# poll notarization status until no longer in-progress | ||
set +ex | ||
while :; do | ||
sleep 60 | ||
_date=$(date) | ||
_output=$(notary_status ${_uuid}) | ||
_status=$(echo "${_output}" | perl -ne 'print if s/^\s*Status: //') | ||
echo "check at ${_date}: Status: ${_status}" | ||
case ${_status} in | ||
"in progress") | ||
continue | ||
;; | ||
"success") | ||
# move on to stapling | ||
break | ||
;; | ||
"") | ||
echo "warn: unknown status -- full output:\n${_output}" 2>&1 | ||
continue | ||
;; | ||
*) | ||
echo "${_output}" 2>&1 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
set -ex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
|
||
[ $# = 2 ] || { | ||
echo "usage: $0 version link pass" 2>&1 | ||
exit 2 | ||
} | ||
|
||
LINK=$1 | ||
PASS=$2 | ||
NODE_MODULES=node_modules | ||
YARNCACHE=.yarncache | ||
|
||
set -ex | ||
[ -d ${NODE_MODULES} ] && rm -rf ${NODE_MODULES} | ||
[ -d ${YARNCACHE} ] && rm -rf ${YARNCACHE} | ||
mkdir -p ${YARNCACHE} | ||
|
||
# prepare directory with package files | ||
yarn install --cache-folder ${YARNCACHE} | ||
yarn rebuild-natives | ||
set WIN_CSC_LINK=${LINK} && set WIN_CSC_KEY_PASSWORD=${PASS} && yarn package-win |