mason.release: Move code signing to its own vocab. Add hooks for mac and windows code signing.

locals-and-roots
Doug Coleman 2016-03-30 11:18:55 -07:00
parent a82ae0027d
commit 7e824ca392
4 changed files with 52 additions and 19 deletions

View File

@ -32,25 +32,8 @@ IN: mason.release.archive
archive-name
} short-running-process ;
: cert-path ( -- path )
home "config/mac_app.cer" append-path ;
: sign-factor.app? ( -- ? ) cert-path exists? ;
: factor.app-path ( -- path )
build-dir get "factor/Factor.app/" append-path ;
:: sign-factor.app ( -- )
${
"codesign" "--force" "--sign"
"Developer ID Application"
cert-path
factor.app-path
} short-running-process ;
! Make the .dmg
: make-macosx-archive ( archive-name -- )
sign-factor.app? [ sign-factor.app ] when
"dmg-root" make-directory
"factor" "dmg-root" copy-tree-into
"factor" "dmg-root" make-disk-image

View File

@ -1,14 +1,15 @@
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: combinators mason.notify mason.release.archive
mason.release.branch mason.release.dlls mason.release.tidy
mason.release.upload ;
mason.release.branch mason.release.dlls mason.release.sign
mason.release.tidy mason.release.upload ;
IN: mason.release
: release ( -- )
update-clean-branch
tidy
copy-dlls
sign-factor-app
archive-name {
[ make-archive ]
[ upload ]

View File

@ -0,0 +1 @@
Doug Coleman

View File

@ -0,0 +1,48 @@
! Copyright (C) 2016 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: io.backend io.pathnames kernel literals locals
mason.common namespaces sequences system ;
IN: mason.release.sign
<<
! Two cases to allow signing in mason or in the UI
: make-factor-path ( path -- path )
build-dir get [
! In a build, make dir: "build-dir/factor/factor.com"
[ "factor/" prepend-path ] dip prepend-path
] [
! Not in build, make dir: "resource:factor.com"
"resource:" prepend-path normalize-path
] if* ;
HOOK: cert-path os ( -- path/f )
M: macosx cert-path
home "config/mac_app.cer" append-path ;
M: windows cert-path
home "config/FactorSPC.pfx" append-path ;
>>
HOOK: sign-factor-app os ( -- )
M: object sign-factor-app ;
M:: macosx sign-factor-app ( -- )
${
"codesign" "--force" "--sign"
"Developer ID Application"
cert-path
"Factor.app/" make-factor-path
} short-running-process ;
M:: windows sign-factor-app ( -- )
{ "factor.com" "factor.exe" } [
[
{
"signtool" "sign"
"/v"
"/f" cert-path
}
] dip make-factor-path suffix short-running-process
] each ;