From d97ef929eae31e3a0d76892ac503dcce3d86b066 Mon Sep 17 00:00:00 2001 From: Kai-Chu Chung Date: Wed, 26 Jun 2024 16:03:02 +0800 Subject: [PATCH] refactor(template): migrate notarize to notarytool --- template/bindata.go | 236 +++++++++----------- template/template.go | 2 +- template/tmpl/partials/step_build_pack.tmpl | 5 +- template/tmpl/partials/step_build_sign.tmpl | 62 +++-- template/tmpl/partials/step_install.tmpl | 2 +- 5 files changed, 131 insertions(+), 176 deletions(-) diff --git a/template/bindata.go b/template/bindata.go index ee7a2d9..85f4b12 100644 --- a/template/bindata.go +++ b/template/bindata.go @@ -1,27 +1,26 @@ -// Code generated by go-bindata. DO NOT EDIT. +// Code generated for package template by go-bindata DO NOT EDIT. (@generated) // sources: -// tmpl/.gitignore.tmpl (3.857kB) -// tmpl/ak.json.tmpl (719B) -// tmpl/cmd.main.tmpl (162B) -// tmpl/cmd.root.tmpl (1.064kB) -// tmpl/cmd.update.tmpl (1.39kB) -// tmpl/dotenv.tmpl (157B) -// tmpl/info.plist.tmpl (808B) -// tmpl/makefile.tmpl (990B) -// tmpl/partials/step_build_pack.tmpl (837B) -// tmpl/partials/step_build_sign.tmpl (2.058kB) -// tmpl/partials/step_install.tmpl (455B) -// tmpl/release.yml.tmpl (709B) -// icons/update-available.png (3.856kB) - +// tmpl/.gitignore.tmpl +// tmpl/ak.json.tmpl +// tmpl/cmd.main.tmpl +// tmpl/cmd.root.tmpl +// tmpl/cmd.update.tmpl +// tmpl/dotenv.tmpl +// tmpl/info.plist.tmpl +// tmpl/makefile.tmpl +// tmpl/partials/step_build_pack.tmpl +// tmpl/partials/step_build_sign.tmpl +// tmpl/partials/step_install.tmpl +// tmpl/release.yml.tmpl +// icons/update-available.png package template import ( "bytes" "compress/gzip" - "crypto/sha256" "fmt" "io" + "io/ioutil" "os" "path/filepath" "strings" @@ -31,28 +30,26 @@ import ( func bindataRead(data, name string) ([]byte, error) { gz, err := gzip.NewReader(strings.NewReader(data)) if err != nil { - return nil, fmt.Errorf("read %q: %w", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer _, err = io.Copy(&buf, gz) + clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("read %q: %w", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } - - clErr := gz.Close() if clErr != nil { - return nil, clErr + return nil, err } return buf.Bytes(), nil } type asset struct { - bytes []byte - info os.FileInfo - digest [sha256.Size]byte + bytes []byte + info os.FileInfo } type bindataFileInfo struct { @@ -62,21 +59,32 @@ type bindataFileInfo struct { modTime time.Time } +// Name return file name func (fi bindataFileInfo) Name() string { return fi.name } + +// Size return file size func (fi bindataFileInfo) Size() int64 { return fi.size } + +// Mode return file mode func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } + +// Mode return file modify time func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } + +// IsDir return file whether a directory func (fi bindataFileInfo) IsDir() bool { - return false + return fi.mode&os.ModeDir != 0 } + +// Sys return file is sys mode func (fi bindataFileInfo) Sys() interface{} { return nil } @@ -96,8 +104,8 @@ func tmplGitignoreTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/.gitignore.tmpl", size: 3857, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0xd6, 0xb9, 0x4b, 0x18, 0x9a, 0x72, 0x31, 0x4e, 0x5, 0x40, 0x3a, 0x61, 0xf0, 0xfe, 0x38, 0x71, 0x73, 0x63, 0x26, 0x83, 0x8b, 0xb3, 0x84, 0x43, 0x60, 0xae, 0x8f, 0xcf, 0xf8, 0x11, 0x30}} + info := bindataFileInfo{name: "tmpl/.gitignore.tmpl", size: 3857, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -116,8 +124,8 @@ func tmplAkJsonTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/ak.json.tmpl", size: 719, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x47, 0xfd, 0xb9, 0x81, 0xc2, 0x2a, 0xa5, 0xd0, 0x86, 0x77, 0xae, 0xa3, 0xb8, 0xd2, 0xf2, 0xf5, 0xcc, 0xdf, 0x31, 0x83, 0x6e, 0x23, 0x37, 0xdf, 0xd7, 0x6f, 0x69, 0xe4, 0xd7, 0x2d, 0xfd, 0xf5}} + info := bindataFileInfo{name: "tmpl/ak.json.tmpl", size: 719, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -136,8 +144,8 @@ func tmplCmdMainTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/cmd.main.tmpl", size: 162, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x31, 0xf6, 0x3a, 0xee, 0xc7, 0xe, 0x2d, 0x59, 0x9e, 0xe8, 0xb5, 0xcd, 0x3d, 0xf1, 0x82, 0xef, 0x94, 0x9e, 0x81, 0xaa, 0x5d, 0x85, 0xf2, 0xbd, 0xc1, 0xc4, 0xbe, 0xea, 0x1c, 0xbd, 0xa2, 0xdb}} + info := bindataFileInfo{name: "tmpl/cmd.main.tmpl", size: 162, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -156,8 +164,8 @@ func tmplCmdRootTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/cmd.root.tmpl", size: 1064, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x40, 0x5d, 0xe7, 0x94, 0xf0, 0xf7, 0x58, 0x3f, 0xaa, 0x88, 0x18, 0xbc, 0x1d, 0x8, 0x17, 0xd2, 0x6f, 0x79, 0x3, 0x7f, 0x97, 0xf1, 0x12, 0xf1, 0xde, 0x3f, 0x19, 0x55, 0xb5, 0x96, 0xce, 0x13}} + info := bindataFileInfo{name: "tmpl/cmd.root.tmpl", size: 1064, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -176,8 +184,8 @@ func tmplCmdUpdateTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/cmd.update.tmpl", size: 1390, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1e, 0x68, 0x3c, 0xc3, 0xfd, 0xea, 0x66, 0x4, 0xe6, 0xd3, 0xe0, 0x3f, 0x48, 0xca, 0xc, 0x9a, 0x46, 0x38, 0xba, 0x50, 0x46, 0x30, 0xaa, 0x8f, 0x9c, 0x59, 0xf7, 0x8f, 0xd, 0xf7, 0x5b, 0x8c}} + info := bindataFileInfo{name: "tmpl/cmd.update.tmpl", size: 1390, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -196,8 +204,8 @@ func tmplDotenvTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/dotenv.tmpl", size: 157, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0xd1, 0x5a, 0xd0, 0xa5, 0x5a, 0xc4, 0x1, 0x23, 0xc1, 0xe6, 0xf8, 0x29, 0x47, 0xda, 0x4, 0x37, 0x5b, 0x8c, 0x17, 0xe9, 0x18, 0xf0, 0x6f, 0x95, 0xdf, 0x18, 0xbc, 0x32, 0x48, 0xfd, 0xff}} + info := bindataFileInfo{name: "tmpl/dotenv.tmpl", size: 157, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -216,8 +224,8 @@ func tmplInfoPlistTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/info.plist.tmpl", size: 808, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x42, 0x89, 0x57, 0x6, 0x2b, 0x50, 0x65, 0x3c, 0x57, 0x6c, 0x6e, 0x67, 0x2a, 0xe6, 0x8c, 0xe1, 0x29, 0x2a, 0xe3, 0x91, 0x32, 0xe9, 0x17, 0xc3, 0xc0, 0xfc, 0xc8, 0x2c, 0x84, 0xc0, 0x7b, 0xb4}} + info := bindataFileInfo{name: "tmpl/info.plist.tmpl", size: 808, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -236,12 +244,12 @@ func tmplMakefileTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/makefile.tmpl", size: 990, mode: os.FileMode(0600), modTime: time.Unix(1697985707, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3, 0xbe, 0x19, 0x6d, 0xb3, 0xb5, 0x1f, 0x20, 0x4d, 0x14, 0xf, 0xef, 0x9, 0xf3, 0x8f, 0xaa, 0xe6, 0x50, 0xbf, 0xe1, 0x6b, 0x6, 0xda, 0x57, 0xe7, 0x73, 0x27, 0x4b, 0xe2, 0xd0, 0xf4, 0xbe}} + info := bindataFileInfo{name: "tmpl/makefile.tmpl", size: 990, mode: os.FileMode(384), modTime: time.Unix(1697985707, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } -var _tmplPartialsStep_build_packTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x52\x4d\x6b\x1b\x31\x10\xbd\xe7\x57\x3c\x54\x1f\xda\x83\x94\x4b\xe9\x21\xe0\x40\x13\x82\x53\x28\x31\x34\xfd\x38\x3a\x93\xd5\xec\x56\x44\x2b\x09\xad\x36\x0e\x55\xf5\xdf\xcb\xda\x1b\x7b\xe3\x1a\x0a\x25\x73\xdb\xb7\x33\xef\xbd\xd1\x3c\x0c\x25\xe1\xa8\xe5\x33\xe0\xa2\x37\x56\x83\x9c\x46\xa0\xea\xe1\x04\x63\xc5\xde\x9d\xe1\x77\xce\xa6\x86\xba\x72\x74\x6f\x59\x2f\xbc\x25\xd7\x94\xb2\xeb\x01\xde\xe0\x7e\x33\x3e\x8c\x52\xc3\x93\x3f\x8b\xe5\xf2\x76\xae\x29\xae\x8d\xc3\x62\xf9\xf1\xcb\xe5\xf5\x9c\x5a\xfd\xe1\x3d\x1a\x3f\xce\x48\xab\x6b\x4b\x4d\x07\x21\x3b\xc8\xf5\x56\xea\xf3\x16\x2b\x05\x39\xef\x3f\x72\x66\xa7\x4b\x11\x90\x1e\xfc\xc4\xab\x0d\xd3\x3f\xc4\x62\xfb\x5a\x62\x03\xd3\x44\xcc\x9a\xe0\x21\xab\xc8\x94\x18\xd2\xf7\x29\xf4\x09\x6a\xed\xe3\x43\x6d\xfd\xfa\x94\x9f\x78\xef\xf1\x28\x41\x6c\x71\x74\x8b\x1d\x7e\xd0\x3f\x1a\x7a\xf1\xec\x2f\x6e\x05\x54\x7a\xef\x60\x02\x07\xdb\x27\x63\x21\x23\x07\x4b\x15\xe3\x91\x63\x67\xbc\x83\xec\x52\x34\xae\x81\xc8\xf9\x6e\x96\x33\xd8\x3d\xaa\x44\x0d\x4a\xb9\x1b\x16\x37\xae\xf6\x2a\x58\xd3\xa5\x09\xd7\x2f\x13\x20\x23\x94\x3a\x15\x39\xab\x1f\xa3\xd8\x0d\xb5\x5c\x8a\x3c\xc6\xa3\xc8\xd6\x91\xf5\xb3\x2d\x01\x75\x60\x58\x9d\x4c\x00\xae\x7e\x7a\x08\x8a\xc9\xd4\x54\xa5\xf9\xec\xed\x16\xf8\x3f\xa9\x77\x02\xe7\xe7\x98\x2d\x3e\x7d\xbd\xfe\x76\xb1\xba\xba\xf9\xbe\xb9\xf7\x90\xf1\xe7\x2c\x5f\x7a\xcd\xb7\xa6\x71\x7f\x87\x3b\xe7\xc4\x6d\xb0\xc3\x71\x45\x97\x38\xac\x36\x01\x5a\x75\xa6\x71\x02\x6a\x17\x8f\x3f\x01\x00\x00\xff\xff\x21\x60\x7b\xd3\x45\x03\x00\x00" +var _tmplPartialsStep_build_packTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x51\x4d\x6b\xdc\x30\x10\xbd\xe7\x57\x3c\xd4\x3d\xb4\x07\x29\x97\xd2\x43\x60\x03\x4d\x08\x9b\x42\xc9\x42\xd3\x8f\xe3\x66\x62\x8d\x5d\x11\x59\x12\xb2\x9c\x0d\x55\xf5\xdf\x8b\xbd\x6e\xd6\x59\x16\x0a\x25\x73\xf3\xf3\xcc\xfb\xd0\xc3\x30\x12\x8e\x5a\x3e\x03\x2e\x7a\x63\x35\xc8\x69\x04\xaa\x1e\x4e\x30\x4d\xec\xdd\x19\x7e\xe7\x6c\x6a\xa8\x2b\x47\xf7\x96\xf5\xca\x5b\x72\x4d\x29\xcf\x3b\xc0\x1b\xdc\x8f\xe7\xc3\x29\x35\x3c\xfb\xb3\x5a\xaf\x6f\x97\x9a\xe2\xd6\x38\xac\xd6\x1f\xbf\x5c\x5e\x2f\xa9\xd5\x1f\xde\xa3\xf1\xd3\x8d\xb4\xba\xb6\xd4\x74\x10\xb2\x83\xdc\xee\xa4\x3e\xef\xb0\x52\x90\xf3\xfe\x23\x67\x76\xba\x14\x01\xe9\xc1\x4f\xbc\x19\x99\xfe\x21\x16\xdb\xd7\x12\x1b\x98\x66\x62\xd6\x04\x0f\x59\x45\xa6\xc4\x90\xbe\x4f\xa1\x4f\x50\x5b\x1f\x1f\x6a\xeb\xb7\xa7\xfc\xc4\x7b\x8f\x47\x09\x62\x8b\xa3\x29\x9e\xf1\x71\x7f\xb2\xf1\xa2\x81\x4b\xaf\xf9\xd6\x34\x0e\x03\x9e\xb8\x0d\x76\xf0\x20\xba\xc4\x61\x33\xe6\xdc\x74\xa6\x71\x02\x6a\x4c\x61\x3b\x3e\x28\xeb\x45\xc3\x40\xa5\xf7\xbe\x67\x70\xb0\x7d\x32\x16\x32\x72\xb0\x54\x31\x1e\x39\x76\xc6\x3b\xc8\x2e\x45\xe3\x1a\x88\x9c\xef\x16\x39\x83\xdd\xa3\x4a\xd4\xa0\x94\xbb\xe1\xb9\x8c\xab\xbd\x0a\xd6\x74\x69\xc6\xf5\xcb\x04\xc8\x08\xa5\x4e\x45\xce\xea\xc7\x24\x76\x43\x2d\x97\x22\x8f\xf1\x28\xb2\x75\x64\xfd\xd7\x96\x80\x3a\x30\xac\x4e\x66\x00\x57\x3f\x3d\x04\xc5\x64\x6a\xaa\xd2\x72\xf1\x76\x07\xfc\x9f\xd4\x3b\x81\xf3\x73\x2c\x56\x9f\xbe\x5e\x7f\xbb\xd8\x5c\xdd\x7c\x9f\x2a\xf8\x13\x00\x00\xff\xff\x02\x38\x59\x9e\x30\x03\x00\x00" func tmplPartialsStep_build_packTmplBytes() ([]byte, error) { return bindataRead( @@ -256,12 +264,12 @@ func tmplPartialsStep_build_packTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/partials/step_build_pack.tmpl", size: 837, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x68, 0x65, 0xb, 0xc5, 0x24, 0x30, 0xa1, 0xce, 0xd4, 0xb4, 0x7c, 0xe1, 0x48, 0x27, 0x49, 0xe8, 0xf, 0x1f, 0xbd, 0xd6, 0xa7, 0x28, 0x82, 0x3a, 0xeb, 0x1c, 0xe4, 0xee, 0xa6, 0x33, 0x36, 0x52}} + info := bindataFileInfo{name: "tmpl/partials/step_build_pack.tmpl", size: 816, mode: os.FileMode(384), modTime: time.Unix(1719380827, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } -var _tmplPartialsStep_build_signTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x55\x51\x6f\xf2\x36\x14\x7d\xff\x7e\xc5\x55\xbe\x3e\x6c\xd2\x12\x44\xf5\xa9\x0f\x51\x5b\x2d\x40\xba\xa2\x75\x05\x01\x6d\x1f\xaa\x2a\x35\xc9\x25\xf1\x6a\x6c\xcb\x36\xb0\x95\xe5\xbf\x4f\x0e\x21\x4d\x20\x55\x35\x34\x3f\x99\x7b\xcf\xbd\x3e\x3e\xd7\x27\x80\x5d\x2e\x70\xb2\x44\x1f\x86\x4b\x29\x94\x81\xbe\x48\xd0\x9d\xd2\x94\x53\x9e\x42\x1f\x95\xa1\x0b\x1a\x13\x83\xfa\x1b\x94\x6b\xa5\x51\xfb\x10\x48\xc9\xd0\x0d\x62\x43\x05\xd7\x1d\x5a\x14\xbb\xb1\x48\x50\xd3\x94\xbb\x31\x2a\xa3\x7f\x5d\x77\xab\xa2\x0d\x35\x99\x5f\xfd\x02\xf8\x0e\xb3\x0c\x21\xae\xf5\x07\xca\x81\xc0\xf8\xf7\xfe\xb4\x7b\x0e\x0b\xca\x10\x90\xdb\x7e\x09\x10\x0d\x04\xe6\x44\xe3\xc5\x0f\xd0\x46\x51\x9e\xd6\x1a\xc9\xee\xb9\x6b\xd1\xee\x0e\xe0\x83\xb3\xdd\xbe\x9e\x6d\xb7\xa0\x31\x56\x68\xb4\x17\x8c\xc7\x77\x61\x34\x08\x1f\xc3\xbb\xd1\x38\x9c\x44\xfd\x70\x32\x1b\xde\x0c\xfb\xc1\x2c\x8c\xc6\xdd\xf3\xa8\x17\x4c\xc3\x8b\x1f\x90\xe7\xaf\x79\xee\x1c\x31\x94\x44\xeb\x8d\x50\x89\xbd\x75\x02\x46\xc0\xee\xa6\x60\x32\xac\x73\xf5\x0e\x18\xed\xcb\xfe\x23\x9d\x60\x3a\x7d\x1a\x4d\x06\x4d\x32\xd5\x80\xb8\x36\x84\x31\x48\x05\x87\x35\x25\x70\x2b\x96\xd8\x53\xb8\x81\x85\x50\x60\x95\x02\x5d\x8e\x8d\xf0\x04\x88\x94\xc0\x85\x21\x8a\xbe\x13\x3b\xa3\x8a\xa0\x5a\x71\x1f\xfe\xa9\xf1\x9d\xdb\x1e\x86\x48\x58\x52\x13\x67\xc8\x58\xd6\x49\x6b\xf8\x12\x40\xcb\xd3\x1b\xa0\x1a\x70\xcf\xb2\x22\x52\xb0\x28\x19\x60\xd5\x0d\xf9\xba\xfe\x0c\x82\x7e\xf4\x30\x0d\x27\xf7\xc1\x1f\x61\x8b\x54\x1f\xc9\xe3\xf1\x04\xfd\x4a\xae\xd6\xca\x76\x2d\x5b\xae\xff\xbd\x10\xb4\xa2\x5d\xcb\xc4\xc4\xc0\xe5\x65\x38\xba\x81\xeb\x6b\x0b\xf2\xfe\xd4\x0d\x5d\xb6\xb5\xbd\x5d\x8e\x16\x2b\x15\xa3\x03\x3e\x3c\x3b\xde\x46\xa8\xb7\x05\x13\x9b\x0e\xfe\x85\xce\xcb\x2f\x87\xd8\xf9\x8a\x27\x0c\x23\x9a\x58\xb8\xb3\xdd\x7a\xbd\x22\x30\x1c\xe4\xb9\x73\x04\xb6\xc4\x1c\xf0\x0f\x0f\x2c\x72\x44\x4a\x66\x1d\x44\x05\x8f\x68\x82\xdc\x50\xf3\xf7\xbe\x67\xf0\x91\x1b\x96\xa9\xa6\x8a\x76\xe5\xdf\xda\xf7\xe1\xe8\xa6\xf6\xcb\x8a\xe4\x32\x91\xba\x0c\xd7\xc8\xae\x12\x9c\xaf\xd2\x5d\xc0\xaa\x02\x5e\xa7\x45\xa0\x86\xca\x92\xc4\x6f\x40\xd8\x42\x61\xb2\x97\xa6\xae\x75\x02\x5e\x4b\x58\xb2\x95\xa1\x0c\x5c\x85\x92\x91\x18\x61\x8d\x4a\x53\xcb\x64\xf7\x1d\xa8\x06\x8f\x7c\xed\x19\x92\x96\xc3\x06\xca\x17\xc2\x93\x8c\x6a\x53\xeb\xf5\x4e\x25\xb8\x0a\x3c\xaf\x63\xa5\x79\x2a\x0f\xbb\x27\x4b\xcc\x73\xb7\xad\x8f\xd7\x64\xeb\x80\x77\x40\xd8\xfb\xec\xae\xf6\xa8\x66\xb1\xfd\x88\x15\x51\x15\x67\x74\x8d\x85\x67\x8f\xcc\x51\x71\x3c\x8d\xa0\xf7\x4e\xa5\x73\x62\xed\xc7\xa3\x38\xb2\x46\x0b\xcd\x86\x33\xf6\xf9\x2f\xed\xb1\x07\x3a\x3e\x3c\xb7\x3e\x65\x49\x4c\xe6\xec\xdd\x3c\x7e\x1a\x58\x9e\x9d\xd3\xa5\x38\xb4\x11\x34\x7d\xf7\xa5\xed\x0a\xbc\x36\x44\x32\x4b\x79\x41\x98\xc6\x43\xeb\xbc\xfc\x3f\xde\xf9\x4c\xc2\xda\x16\xe3\x4c\x80\x43\xec\xff\x25\x89\xcd\xd5\xd9\x4f\xbb\xc0\x69\xc3\xfe\xd9\xb1\x83\x3b\xfb\x6d\x38\xbb\x7d\xe8\x45\xe1\xfd\xe3\xbf\x01\x00\x00\xff\xff\x11\x6f\x15\x13\x0a\x08\x00\x00" +var _tmplPartialsStep_build_signTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xa4\x54\x5d\x6f\xda\x30\x14\x7d\xef\xaf\xb8\xf2\x78\xd8\xa4\x3a\xa8\xd3\xb4\x87\xa8\x54\xea\x4a\xb4\x21\x75\x80\x80\xb6\x8f\xa9\x71\x6e\xa8\x45\x62\x5b\xb6\x43\x3f\x18\xff\x7d\x4a\x69\x52\x03\x61\x74\x6d\x1e\x50\xb8\xdc\x7b\xce\xe1\xf8\x1e\x43\xf9\x50\x90\x2c\xc7\x10\x2e\x94\x4c\xc5\xac\x30\x08\x39\xe3\x83\x31\x58\x31\x93\x42\xce\x8e\xe0\xe5\x41\xb9\x08\xeb\x2f\x00\xe7\xc3\xe1\x65\x14\x77\xa3\xeb\xe8\x72\x30\x8c\x46\x71\xaf\x1b\xc2\x72\x79\xdb\x5a\x2e\x61\xc1\x8c\x0d\x76\x7f\x87\xd5\xea\x76\xb5\xda\x81\x28\x3f\x7b\x17\xe7\x93\xde\xa0\x1f\x5f\x44\xa3\x49\x0d\x63\x91\x1b\x74\x15\xd2\x76\xdb\x1b\xd1\xe2\xe1\xf9\x78\x7c\x33\x18\x75\xdf\x08\x5b\xf7\x6f\xe1\x9b\x42\x86\xf0\xc7\xa3\x9b\xe3\x23\xbf\x63\x42\x76\x48\x6b\x74\xd5\xef\x47\xa3\x78\x12\xfd\x1e\xb6\xa7\x85\xc8\x12\x36\x43\xe9\x82\xaa\x83\x34\x4c\xc5\x9a\x59\x7b\xaf\x4c\xd2\x21\xd5\xdb\x09\x39\xf2\x1a\x2d\xf2\xc2\x08\xf7\x08\xdc\x20\x73\x48\xab\x41\xa0\x1a\x48\x6b\x07\x86\x78\x45\xd2\x04\x93\x60\xca\x8a\xcc\x79\x38\xf6\xd0\x48\x21\x33\xc5\xe7\xff\xc7\xec\xe1\x4c\x99\xc5\xef\xdf\x80\x76\xe1\xf4\xf4\x94\xb4\x9a\xed\x26\x70\x06\x9b\x06\x72\x34\x2e\xd0\x27\x5f\x1b\x25\x89\x5c\x2b\xe3\xf6\x4d\x00\x9d\xfb\x62\x80\x0e\x61\x1f\x6f\x7d\xcc\x04\xe8\x04\xda\x85\x35\xed\xa9\x90\x6d\xae\x12\x2c\xf7\xbe\x89\xdb\xe2\xb3\x7b\x54\x33\xe3\x84\x13\x4a\xd2\x4c\x58\x07\x74\x0c\x84\x69\x9d\x21\x75\x4a\x65\xe1\xf1\xf3\x7b\x78\x5c\x21\x85\xa4\x74\x7a\x43\xd8\xc1\x43\x33\xf9\x01\x4f\xaa\xc8\x56\x24\xc0\x64\x02\x52\x39\x66\xc4\x13\xfe\x3b\xb0\xcd\x31\xdd\x1b\xce\x5e\xf7\x50\x80\xbc\x8e\x3d\x18\x1f\xb8\x23\x76\x52\xf7\x09\x1a\x8e\xa8\xb6\x81\x52\x27\x72\xb4\x8e\xe5\x1a\x28\x55\xba\x3c\x25\xdb\x31\x85\x2c\xcb\xeb\x8d\xdf\xa5\x24\x40\x17\x10\xdc\x2b\x33\x4f\x33\x75\xdf\xc6\x07\xf4\xa0\x37\xa8\x35\xe3\x73\x60\x59\x6a\x30\xa9\xda\x7d\x15\xc9\x2b\x8a\x57\xd6\x59\xe1\x44\x06\xd4\xa0\xce\x18\x47\x58\xa0\xb1\x42\x95\xf9\x73\x46\xc8\x19\x90\x17\x43\x50\x2e\x02\xc7\x66\x6b\x03\x08\x08\x99\xaa\x40\x97\x1b\xe6\x61\x3d\x09\x0d\xd4\x40\x10\xb4\xc9\x72\x19\xdc\xbc\x90\xf5\x59\x8e\xab\x15\x6d\xc2\x09\x36\xd5\x12\x08\xb6\x04\x07\xfb\xfe\x6b\x49\xb5\x39\x0c\xcc\xae\xab\x86\xdf\x89\x05\x42\xaa\xcc\xee\xce\xd5\x1a\xdf\x27\x30\x78\x12\x9a\xbc\x73\x76\xe3\xf2\x79\xe0\xa6\x90\x6b\x79\x8f\x65\x2e\xc1\x16\xd3\x5c\xb8\x0f\xc9\xa2\x74\x9d\x73\x91\xd4\x7b\xf4\xbc\x3d\xd4\x21\xcb\xfd\xea\xd6\x76\xd1\x2a\xef\xde\xd8\xeb\xfd\xe3\xab\x46\x7e\xa7\x80\x94\xf7\x4b\xca\xb8\xeb\xb4\x3e\xaf\x0b\xef\xb3\xe3\x0b\x81\xb3\x33\x68\xfd\xec\x4d\x7e\x5d\xfd\x88\xa3\xfe\xf5\xdf\x00\x00\x00\xff\xff\x96\x15\xee\xdf\xee\x07\x00\x00" func tmplPartialsStep_build_signTmplBytes() ([]byte, error) { return bindataRead( @@ -276,12 +284,12 @@ func tmplPartialsStep_build_signTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/partials/step_build_sign.tmpl", size: 2058, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0xe9, 0x93, 0x74, 0x5b, 0x26, 0xb9, 0x71, 0x6c, 0xd6, 0xe, 0x97, 0x75, 0x92, 0x55, 0x17, 0xdf, 0x4c, 0xbe, 0xf, 0xbf, 0x19, 0xa5, 0xd4, 0xeb, 0x1c, 0xa5, 0x99, 0xda, 0x25, 0xf5, 0xab}} + info := bindataFileInfo{name: "tmpl/partials/step_build_sign.tmpl", size: 2030, mode: os.FileMode(384), modTime: time.Unix(1719380949, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } -var _tmplPartialsStep_installTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x4f\x4d\x6b\xe3\x30\x10\xbd\xef\xaf\x78\x84\x3d\x24\x07\xcb\xb0\x47\xb1\x81\x42\x1a\x4a\x29\x34\x50\x4a\xaf\x8d\x22\x4f\x1c\x81\x2d\xb9\x9a\x91\x1b\x50\xfd\xdf\x4b\x52\xd7\x69\xe8\x5c\xc4\xcc\x7b\x7a\x1f\x38\x4d\x01\x6f\x5a\xd2\xb8\xf7\x2c\xa6\x69\x70\x17\xfe\x60\x1c\xb7\xd7\xe0\x64\x2d\x31\xcf\x17\xd3\x35\x31\xb1\x86\xb1\xe2\x82\xe7\x92\x49\x52\x57\xd4\xe1\xa6\xff\x37\x31\xde\x9d\x1c\xf4\xb4\x01\x75\x28\x7a\x8a\xec\x82\xd7\xc8\x79\xfb\x37\x67\xb4\x46\xa2\x3b\xaa\x0b\x82\x61\xd8\x0e\xc3\xf8\xe9\x3b\xd3\x53\xf2\x48\xde\x09\x84\x58\x78\x52\x8c\xc9\x6b\xd4\xe1\x7c\x45\xd1\xa3\x88\xc6\x12\x0a\x1b\x7a\x8a\xe3\xd3\xc5\xb0\x77\x0d\xe1\xbc\x98\x9a\x94\x1c\x65\x84\xda\x50\xd1\xd2\x48\x68\x9d\x85\x2a\x95\x52\x39\xbb\x3d\xe8\x0d\x6a\xed\xcd\xae\xa1\x6a\x15\x2a\xb2\xa1\x87\xc4\x44\xbf\x22\xa5\xae\x32\x72\xd2\x3d\x73\xae\x23\x7d\xfc\xe8\xbc\xda\xdc\xae\x57\x9b\x97\xd7\xe7\xcd\xc3\xfa\x71\x39\x1b\x6b\x33\xd9\x48\xc2\xea\x0a\xfd\xaa\x3e\xc3\xce\xf0\x01\xff\xe7\x36\xc5\x06\x05\xe3\x20\xd2\xb1\x2e\xcb\xd1\x4a\xb9\x50\x9e\x18\x8b\x9c\xc9\x57\xc3\x70\xb1\xfa\x0c\x00\x00\xff\xff\xf7\xb4\x97\x3e\xc7\x01\x00\x00" +var _tmplPartialsStep_installTmpl = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x64\x4f\x41\x4b\x33\x31\x14\xbc\x7f\xbf\x62\x28\xdf\xa1\x3d\x6c\x16\x3c\x06\x0b\x42\x2d\x22\x82\x05\x11\xaf\x36\xcd\xbe\x6e\x03\xbb\xc9\x9a\xf7\xb2\x16\xe2\xfe\x77\x69\x5d\x57\x8b\xef\x12\xde\xcc\x64\xde\x0c\x4e\x53\xc0\x9b\x96\x34\xee\x3d\x8b\x69\x1a\xdc\x85\x7f\x18\xc7\xed\x35\x38\x59\x4b\xcc\xf3\xc5\x84\x26\x26\xd6\x30\x56\x5c\xf0\x5c\x32\x49\xea\x8a\x3a\xdc\xf4\x57\x93\xe2\xdd\xc9\x41\x4f\x1b\x50\x87\xa2\xa7\xc8\x2e\x78\x8d\x9c\xb7\xff\x73\x46\x6b\x24\xba\xa3\xfa\x61\x30\x0c\xdb\x61\x18\x3f\x7d\x67\x7a\x4a\x1e\xc9\x3b\x81\x10\x0b\x4f\x8e\x31\x79\x8d\x3a\x9c\x51\x14\x3d\x8a\x68\x2c\xa1\xb0\xa1\xa7\x38\x3e\x5d\x0c\x7b\xd7\x10\xce\x8b\xa9\x49\xc9\x51\x46\xaa\x0d\x15\x2d\x8d\x84\xd6\x59\xa8\x52\x29\x95\xb3\xdb\x83\xde\xa0\xd6\xde\xec\x1a\xaa\x56\xa1\x22\x1b\x7a\x48\x4c\xf4\x27\x52\xea\x2a\x23\x27\xdf\xb3\xe6\x32\xd2\xc7\xaf\xce\xab\xcd\xed\x7a\xb5\x79\x79\x7d\xde\x3c\xac\x1f\x97\xb3\xb1\x36\x93\x8d\x24\xac\x2e\xd8\xaf\xea\x33\xec\x0c\x1f\x70\x3d\xb7\x29\x36\x28\x18\x07\x91\x8e\x75\x59\x8e\xa7\x94\x0b\xe5\x49\xb1\xc8\x99\x7c\x35\x0c\x9f\x01\x00\x00\xff\xff\x64\xce\x88\x23\xbd\x01\x00\x00" func tmplPartialsStep_installTmplBytes() ([]byte, error) { return bindataRead( @@ -296,8 +304,8 @@ func tmplPartialsStep_installTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/partials/step_install.tmpl", size: 455, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x5c, 0xb8, 0xe, 0xeb, 0x21, 0x74, 0xd2, 0xc, 0xfe, 0x83, 0xb3, 0x7f, 0x93, 0x97, 0xf2, 0xd5, 0x8e, 0xef, 0xca, 0xca, 0xde, 0x6, 0x23, 0xb8, 0x9d, 0x91, 0x50, 0x5f, 0x57, 0xd6, 0x72, 0x55}} + info := bindataFileInfo{name: "tmpl/partials/step_install.tmpl", size: 445, mode: os.FileMode(384), modTime: time.Unix(1719379808, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -316,8 +324,8 @@ func tmplReleaseYmlTmpl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "tmpl/release.yml.tmpl", size: 709, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xba, 0x46, 0xcf, 0x58, 0xfb, 0xc1, 0x65, 0x94, 0x3f, 0xb3, 0x73, 0xcd, 0x48, 0x3a, 0x20, 0x57, 0x1d, 0x20, 0x87, 0x9, 0x1c, 0x8, 0x16, 0xdd, 0xa5, 0x48, 0xfd, 0xfd, 0x35, 0x44, 0x7f, 0xa6}} + info := bindataFileInfo{name: "tmpl/release.yml.tmpl", size: 709, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -336,8 +344,8 @@ func iconsUpdateAvailablePng() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "icons/update-available.png", size: 3856, mode: os.FileMode(0600), modTime: time.Unix(1694100126, 0)} - a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0xdc, 0xcf, 0x7e, 0x97, 0xb0, 0x94, 0x8d, 0xef, 0xed, 0x6f, 0x33, 0xa8, 0x1d, 0xfd, 0x41, 0x7e, 0xbf, 0xd5, 0x65, 0xcc, 0x17, 0xc8, 0x95, 0x54, 0xa3, 0xcc, 0x51, 0x27, 0x7a, 0xf2, 0x2f}} + info := bindataFileInfo{name: "icons/update-available.png", size: 3856, mode: os.FileMode(384), modTime: time.Unix(1694100126, 0)} + a := &asset{bytes: bytes, info: info} return a, nil } @@ -345,8 +353,8 @@ func iconsUpdateAvailablePng() (*asset, error) { // It returns an error if the asset could not be found or // could not be loaded. func Asset(name string) ([]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) @@ -356,12 +364,6 @@ func Asset(name string) ([]byte, error) { return nil, fmt.Errorf("Asset %s not found", name) } -// AssetString returns the asset contents as a string (instead of a []byte). -func AssetString(name string) (string, error) { - data, err := Asset(name) - return string(data), err -} - // MustAsset is like Asset but panics when Asset would return an error. // It simplifies safe initialization of global variables. func MustAsset(name string) []byte { @@ -373,18 +375,12 @@ func MustAsset(name string) []byte { return a } -// MustAssetString is like AssetString but panics when Asset would return an -// error. It simplifies safe initialization of global variables. -func MustAssetString(name string) string { - return string(MustAsset(name)) -} - // AssetInfo loads and returns the asset info for the given name. // It returns an error if the asset could not be found or // could not be loaded. func AssetInfo(name string) (os.FileInfo, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { + cannonicalName := strings.Replace(name, "\\", "/", -1) + if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) @@ -394,33 +390,6 @@ func AssetInfo(name string) (os.FileInfo, error) { return nil, fmt.Errorf("AssetInfo %s not found", name) } -// AssetDigest returns the digest of the file with the given name. It returns an -// error if the asset could not be found or the digest could not be loaded. -func AssetDigest(name string) ([sha256.Size]byte, error) { - canonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[canonicalName]; ok { - a, err := f() - if err != nil { - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s can't read by error: %v", name, err) - } - return a.digest, nil - } - return [sha256.Size]byte{}, fmt.Errorf("AssetDigest %s not found", name) -} - -// Digests returns a map of all known files and their checksums. -func Digests() (map[string][sha256.Size]byte, error) { - mp := make(map[string][sha256.Size]byte, len(_bindata)) - for name := range _bindata { - a, err := _bindata[name]() - if err != nil { - return nil, err - } - mp[name] = a.digest - } - return mp, nil -} - // AssetNames returns the names of the assets. func AssetNames() []string { names := make([]string, 0, len(_bindata)) @@ -447,29 +416,24 @@ var _bindata = map[string]func() (*asset, error){ "icons/update-available.png": iconsUpdateAvailablePng, } -// AssetDebug is true if the assets were built with the debug flag enabled. -const AssetDebug = false - // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// -// then AssetDir("data") would return []string{"foo.txt", "img"}, -// AssetDir("data/img") would return []string{"a.png", "b.png"}, -// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and +// data/ +// foo.txt +// img/ +// a.png +// b.png +// then AssetDir("data") would return []string{"foo.txt", "img"} +// AssetDir("data/img") would return []string{"a.png", "b.png"} +// AssetDir("foo.txt") and AssetDir("notexist") would return an error // AssetDir("") will return []string{"data"}. func AssetDir(name string) ([]string, error) { node := _bintree if len(name) != 0 { - canonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(canonicalName, "/") + cannonicalName := strings.Replace(name, "\\", "/", -1) + pathList := strings.Split(cannonicalName, "/") for _, p := range pathList { node = node.Children[p] if node == nil { @@ -493,28 +457,28 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "icons": {nil, map[string]*bintree{ - "update-available.png": {iconsUpdateAvailablePng, map[string]*bintree{}}, + "icons": &bintree{nil, map[string]*bintree{ + "update-available.png": &bintree{iconsUpdateAvailablePng, map[string]*bintree{}}, }}, - "tmpl": {nil, map[string]*bintree{ - ".gitignore.tmpl": {tmplGitignoreTmpl, map[string]*bintree{}}, - "ak.json.tmpl": {tmplAkJsonTmpl, map[string]*bintree{}}, - "cmd.main.tmpl": {tmplCmdMainTmpl, map[string]*bintree{}}, - "cmd.root.tmpl": {tmplCmdRootTmpl, map[string]*bintree{}}, - "cmd.update.tmpl": {tmplCmdUpdateTmpl, map[string]*bintree{}}, - "dotenv.tmpl": {tmplDotenvTmpl, map[string]*bintree{}}, - "info.plist.tmpl": {tmplInfoPlistTmpl, map[string]*bintree{}}, - "makefile.tmpl": {tmplMakefileTmpl, map[string]*bintree{}}, - "partials": {nil, map[string]*bintree{ - "step_build_pack.tmpl": {tmplPartialsStep_build_packTmpl, map[string]*bintree{}}, - "step_build_sign.tmpl": {tmplPartialsStep_build_signTmpl, map[string]*bintree{}}, - "step_install.tmpl": {tmplPartialsStep_installTmpl, map[string]*bintree{}}, + "tmpl": &bintree{nil, map[string]*bintree{ + ".gitignore.tmpl": &bintree{tmplGitignoreTmpl, map[string]*bintree{}}, + "ak.json.tmpl": &bintree{tmplAkJsonTmpl, map[string]*bintree{}}, + "cmd.main.tmpl": &bintree{tmplCmdMainTmpl, map[string]*bintree{}}, + "cmd.root.tmpl": &bintree{tmplCmdRootTmpl, map[string]*bintree{}}, + "cmd.update.tmpl": &bintree{tmplCmdUpdateTmpl, map[string]*bintree{}}, + "dotenv.tmpl": &bintree{tmplDotenvTmpl, map[string]*bintree{}}, + "info.plist.tmpl": &bintree{tmplInfoPlistTmpl, map[string]*bintree{}}, + "makefile.tmpl": &bintree{tmplMakefileTmpl, map[string]*bintree{}}, + "partials": &bintree{nil, map[string]*bintree{ + "step_build_pack.tmpl": &bintree{tmplPartialsStep_build_packTmpl, map[string]*bintree{}}, + "step_build_sign.tmpl": &bintree{tmplPartialsStep_build_signTmpl, map[string]*bintree{}}, + "step_install.tmpl": &bintree{tmplPartialsStep_installTmpl, map[string]*bintree{}}, }}, - "release.yml.tmpl": {tmplReleaseYmlTmpl, map[string]*bintree{}}, + "release.yml.tmpl": &bintree{tmplReleaseYmlTmpl, map[string]*bintree{}}, }}, }} -// RestoreAsset restores an asset under the given directory. +// RestoreAsset restores an asset under the given directory func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { @@ -528,14 +492,18 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.WriteFile(_filePath(dir, name), data, info.Mode()) + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } - return os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) + err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) + if err != nil { + return err + } + return nil } -// RestoreAssets restores an asset under the given directory recursively. +// RestoreAssets restores an asset under the given directory recursively func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File @@ -553,6 +521,6 @@ func RestoreAssets(dir, name string) error { } func _filePath(dir, name string) string { - canonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(canonicalName, "/")...)...) + cannonicalName := strings.Replace(name, "\\", "/", -1) + return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } diff --git a/template/template.go b/template/template.go index 739920f..6c0bbdc 100644 --- a/template/template.go +++ b/template/template.go @@ -99,5 +99,5 @@ func (e *DefaultEngine) ExecuteString(data string, model interface{}) (string, e } func (e *DefaultEngine) MustAssetString(name string) string { - return MustAssetString(name) + return string(MustAsset(name)) } diff --git a/template/tmpl/partials/step_build_pack.tmpl b/template/tmpl/partials/step_build_pack.tmpl index 26bf387..4921b4b 100644 --- a/template/tmpl/partials/step_build_pack.tmpl +++ b/template/tmpl/partials/step_build_pack.tmpl @@ -6,12 +6,11 @@ lipo -create -output .workflow/exe exe_amd64 exe_arm64 rm exe_amd64 rm exe_arm64 - {{end}} +{{end}}{{if .EnabledCodeSign }}{{template "step_build_sign" .}}{{else}} # pack cd .workflow plutil -replace version -string "{{`${{ env.tag }}`}}" info.plist zip -r ../"{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow" . cd .. - echo "artifact=$(echo "{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow")" >> $GITHUB_ENV{{if and .EnabledCodeSign .EnabledGolang}} -{{template "step_build_sign" .}}{{end}} \ No newline at end of file + echo "artifact=$(echo "{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow")" >> $GITHUB_ENV{{end}} \ No newline at end of file diff --git a/template/tmpl/partials/step_build_sign.tmpl b/template/tmpl/partials/step_build_sign.tmpl index 8667ae6..46c38c2 100644 --- a/template/tmpl/partials/step_build_sign.tmpl +++ b/template/tmpl/partials/step_build_sign.tmpl @@ -1,30 +1,28 @@ - - name: Import Code-Signing Certificates - uses: Apple-Actions/import-codesign-certs@v1 - with: - # The certificates in a PKCS12 file encoded as a base64 string - p12-file-base64: "{{`${{ secrets.APPLE_DEVELOPER_CERTIFICATE_P12_BASE64 }}`}}" - # The password used to import the PKCS12 file. - p12-password: "{{`${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }}`}}" - - name: Install gon via HomeBrew for code signing and app notarization + - name: Configure macOS signing + env: + APPLE_DEVELOPER_ID: {{`${{ vars.APPLE_DEVELOPER_ID }}`}} + APPLE_APPLICATION_CERT: {{`${{ secrets.APPLE_APPLICATION_CERT }}`}} + APPLE_APPLICATION_CERT_PASSWORD: {{`${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }}`}} run: | - brew tap mitchellh/gon - brew install mitchellh/gon/gon - - name: code sign and notarize + keychain="$RUNNER_TEMP/buildagent.keychain" + keychain_password="password1" + + security create-keychain -p "$keychain_password" "$keychain" + security default-keychain -s "$keychain" + security unlock-keychain -p "$keychain_password" "$keychain" + + base64 -D <<<"$APPLE_APPLICATION_CERT" > "$RUNNER_TEMP/cert.p12" + security import "$RUNNER_TEMP/cert.p12" -k "$keychain" -P "$APPLE_APPLICATION_CERT_PASSWORD" -T /usr/bin/codesign + security set-key-partition-list -S "apple-tool:,apple:,codesign:" -s -k "$keychain_password" "$keychain" + rm "$RUNNER_TEMP/cert.p12" + - name: codesign and notarize env: - AC_USERNAME: "{{`${{ secrets.AC_USERNAME }}`}}" - AC_PASSWORD: "{{`${{ secrets.AC_PASSWORD }}`}}" + APPLE_ID: {{`${{ vars.APPLE_ID }}`}} + APPLE_ID_PASSWORD: {{`${{ secrets.APPLE_ID_PASSWORD }}`}} + APPLE_DEVELOPER_ID: {{`${{ vars.APPLE_DEVELOPER_ID }}`}} run: | - # gon code sign - cat <> gon.json - { - "source" : [".workflow/exe"], - "bundle_id" : "{{.BundleID}}", - "sign" :{ - "application_identity" : "{{.ApplicationIdentity}}" - } - } - EOF - gon -log-level=debug -log-json ./gon.json + # codesign + codesign --timestamp --options=runtime -s "$APPLE_DEVELOPER_ID" -v .workflow/exe # pack alfredworkflow cd .workflow @@ -34,17 +32,7 @@ # zip alfredworkflow as zip archive for notarize zip -r "{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow.zip" "{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow" - - # gon notarize - cat <> notarize.json - { - "notarize": [{ - "path": "{{`${PWD}`}}/{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow.zip", - "bundle_id": "{{.BundleID}}", - "staple": false - }] - } - EOF - gon -log-level=debug -log-json ./notarize.json - + + xcrun notarytool submit "{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow.zip" --apple-id "$APPLE_ID" --team-id "$APPLE_DEVELOPER_ID" --password "$APPLE_ID_PASSWORD" + echo "artifact=$(echo "{{.WorkflowName}}-{{`${{ env.tag }}`}}.alfredworkflow")" >> $GITHUB_ENV \ No newline at end of file diff --git a/template/tmpl/partials/step_install.tmpl b/template/tmpl/partials/step_install.tmpl index 380e8ef..9f5a872 100644 --- a/template/tmpl/partials/step_install.tmpl +++ b/template/tmpl/partials/step_install.tmpl @@ -7,4 +7,4 @@ run: go test -v -race -cover -coverprofile coverage.txt -covermode=atomic ./...{{if eq .EnabledCodecov true}} - name: update codecov run: | - CODECOV_TOKEN="{{`${{ secrets.CODECOV_TOKEN }}`}}" bash <(curl -s https://codecov.io/bash){{end}} \ No newline at end of file + CODECOV_TOKEN="{{`${{ secrets.CODECOV_TOKEN }}`}}" bash <(curl -s https://codecov.io/bash){{end}} \ No newline at end of file