chore: refactor scripts for octokit update (#16284)

* chore: refactor scripts for octokit

* update release script

* update more octokit scripts

* cleanup

* remove unecessary refactor

* fixup package lock
This commit is contained in:
Shelley Vohr 2019-01-08 12:05:58 -08:00 коммит произвёл GitHub
Родитель 434f1368a0
Коммит 000be5d1d4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 444 добавлений и 280 удалений

459
package-lock.json сгенерированный
Просмотреть файл

@ -83,6 +83,56 @@
"integrity": "sha512-yprFYuno9FtNsSHVlSWd+nRlmGoAbqbeCwOryP6sC/zoCjhpArcRMYp19EvpSUSizJAlsXEwJv+wcWS9XaXdMw==",
"dev": true
},
"@octokit/endpoint": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-3.1.1.tgz",
"integrity": "sha512-KPkoTvKwCTetu/UqonLs1pfwFO5HAqTv/Ksp9y4NAg//ZgUCpvJsT4Hrst85uEzJvkB8+LxKyR4Bfv2X8O4cmQ==",
"dev": true,
"requires": {
"deepmerge": "3.0.0",
"is-plain-object": "^2.0.4",
"universal-user-agent": "^2.0.1",
"url-template": "^2.0.8"
}
},
"@octokit/request": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-2.2.1.tgz",
"integrity": "sha512-enwbVOl3vWWIUuEj0LJRq+mxWNyv95fa13GJitz7qGt/ycYCwtSoVssW3pCqvxS4GlJfHfO2OA+8czIcEF522A==",
"dev": true,
"requires": {
"@octokit/endpoint": "^3.1.1",
"is-plain-object": "^2.0.4",
"node-fetch": "^2.3.0",
"universal-user-agent": "^2.0.1"
},
"dependencies": {
"node-fetch": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz",
"integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==",
"dev": true
}
}
},
"@octokit/rest": {
"version": "16.6.1",
"resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.6.1.tgz",
"integrity": "sha512-3F9c6ldPT6N123iGcuEZMfrE6BvL/Z4F+V80zbA3KS6vGWRm3RS4OblF6age+dCtlMsa99t13AeTmWD7Bsea0Q==",
"dev": true,
"requires": {
"@octokit/request": "2.2.1",
"before-after-hook": "^1.2.0",
"btoa-lite": "^1.0.0",
"lodash.get": "^4.4.2",
"lodash.pick": "^4.4.0",
"lodash.set": "^4.3.2",
"lodash.uniq": "^4.5.0",
"octokit-pagination-methods": "^1.1.0",
"universal-user-agent": "^2.0.0",
"url-template": "^2.0.8"
}
},
"@types/node": {
"version": "7.0.70",
"resolved": "https://registry.npmjs.org/@types/node/-/node-7.0.70.tgz",
@ -194,24 +244,6 @@
"integrity": "sha512-z55ocwKBRLryBs394Sm3ushTtBeg6VAeuku7utSoSnsJKvKcnXFIyC6vh27n3rXyxSgkJBBCAvyOn7gSUcTYjg==",
"dev": true
},
"agent-base": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz",
"integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=",
"dev": true,
"requires": {
"extend": "~3.0.0",
"semver": "~5.0.1"
},
"dependencies": {
"semver": {
"version": "5.0.3",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz",
"integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=",
"dev": true
}
}
},
"ajv": {
"version": "5.5.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
@ -720,6 +752,12 @@
"tweetnacl": "^0.14.3"
}
},
"before-after-hook": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-1.3.1.tgz",
"integrity": "sha512-BIjg60OP/sQvG7Q2L9Xkc77gyyFw1B4T73LIfZVQtXbutJinC1+t2HRl4qeR3EWAmY+tA6z9vpRi02q6ZXyluQ==",
"dev": true
},
"binary": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/binary/-/binary-0.3.0.tgz",
@ -1126,6 +1164,12 @@
"pako": "~0.2.0"
}
},
"btoa-lite": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz",
"integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=",
"dev": true
},
"buffer": {
"version": "4.9.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz",
@ -2277,6 +2321,12 @@
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
"dev": true
},
"deepmerge": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-3.0.0.tgz",
"integrity": "sha512-a8z8bkgHsAML+uHLqmMS83HHlpy3PvZOOuiTQqaa3wu8ZVg3h0hqHk6aCsGdOnZV2XMM/FRimNGjUh0KCcmHBw==",
"dev": true
},
"defaults": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
@ -4078,16 +4128,6 @@
}
}
},
"follow-redirects": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-0.0.7.tgz",
"integrity": "sha1-NLkLqyqRGqNHVx2pDyK9NuzYqRk=",
"dev": true,
"requires": {
"debug": "^2.2.0",
"stream-consume": "^0.1.0"
}
},
"for-in": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
@ -4194,24 +4234,28 @@
"dependencies": {
"abbrev": {
"version": "1.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"dev": true,
"optional": true
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"aproba": {
"version": "1.2.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"dev": true,
"optional": true
},
"are-we-there-yet": {
"version": "1.1.4",
"bundled": true,
"resolved": false,
"integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=",
"dev": true,
"optional": true,
"requires": {
@ -4221,15 +4265,15 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"resolved": false,
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -4237,37 +4281,40 @@
},
"chownr": {
"version": "1.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=",
"dev": true,
"optional": true
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"dev": true,
"optional": true
},
"debug": {
"version": "2.6.9",
"bundled": true,
"resolved": false,
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"optional": true,
"requires": {
@ -4276,25 +4323,29 @@
},
"deep-extend": {
"version": "0.5.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==",
"dev": true,
"optional": true
},
"delegates": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
"dev": true,
"optional": true
},
"detect-libc": {
"version": "1.0.3",
"bundled": true,
"resolved": false,
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"dev": true,
"optional": true
},
"fs-minipass": {
"version": "1.2.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
"dev": true,
"optional": true,
"requires": {
@ -4303,13 +4354,15 @@
},
"fs.realpath": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true,
"optional": true
},
"gauge": {
"version": "2.7.4",
"bundled": true,
"resolved": false,
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"dev": true,
"optional": true,
"requires": {
@ -4325,7 +4378,8 @@
},
"glob": {
"version": "7.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"optional": true,
"requires": {
@ -4339,13 +4393,15 @@
},
"has-unicode": {
"version": "2.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
"dev": true,
"optional": true
},
"iconv-lite": {
"version": "0.4.21",
"bundled": true,
"resolved": false,
"integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==",
"dev": true,
"optional": true,
"requires": {
@ -4354,7 +4410,8 @@
},
"ignore-walk": {
"version": "3.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
"dev": true,
"optional": true,
"requires": {
@ -4363,7 +4420,8 @@
},
"inflight": {
"version": "1.0.6",
"bundled": true,
"resolved": false,
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"optional": true,
"requires": {
@ -4373,51 +4431,53 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"dev": true
},
"ini": {
"version": "1.3.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true,
"optional": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
},
"isarray": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"dev": true,
"optional": true
},
"minimatch": {
"version": "3.0.4",
"bundled": true,
"resolved": false,
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"resolved": false,
"integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==",
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -4425,7 +4485,8 @@
},
"minizlib": {
"version": "1.1.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==",
"dev": true,
"optional": true,
"requires": {
@ -4434,22 +4495,24 @@
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
},
"ms": {
"version": "2.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
"dev": true,
"optional": true
},
"needle": {
"version": "2.2.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==",
"dev": true,
"optional": true,
"requires": {
@ -4460,7 +4523,8 @@
},
"node-pre-gyp": {
"version": "0.10.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==",
"dev": true,
"optional": true,
"requires": {
@ -4478,7 +4542,8 @@
},
"nopt": {
"version": "4.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
"dev": true,
"optional": true,
"requires": {
@ -4488,13 +4553,15 @@
},
"npm-bundled": {
"version": "1.0.3",
"bundled": true,
"resolved": false,
"integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==",
"dev": true,
"optional": true
},
"npm-packlist": {
"version": "1.1.10",
"bundled": true,
"resolved": false,
"integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==",
"dev": true,
"optional": true,
"requires": {
@ -4504,7 +4571,8 @@
},
"npmlog": {
"version": "4.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"dev": true,
"optional": true,
"requires": {
@ -4516,40 +4584,44 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"resolved": false,
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"dev": true
},
"object-assign": {
"version": "4.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"dev": true,
"optional": true
},
"once": {
"version": "1.4.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
},
"os-homedir": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true,
"optional": true
},
"os-tmpdir": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true,
"optional": true
},
"osenv": {
"version": "0.1.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"dev": true,
"optional": true,
"requires": {
@ -4559,19 +4631,22 @@
},
"path-is-absolute": {
"version": "1.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true,
"optional": true
},
"process-nextick-args": {
"version": "2.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"dev": true,
"optional": true
},
"rc": {
"version": "1.2.7",
"bundled": true,
"resolved": false,
"integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==",
"dev": true,
"optional": true,
"requires": {
@ -4583,7 +4658,8 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true,
"optional": true
}
@ -4591,7 +4667,8 @@
},
"readable-stream": {
"version": "2.3.6",
"bundled": true,
"resolved": false,
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"optional": true,
"requires": {
@ -4606,7 +4683,8 @@
},
"rimraf": {
"version": "2.6.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"dev": true,
"optional": true,
"requires": {
@ -4615,44 +4693,50 @@
},
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"dev": true
},
"safer-buffer": {
"version": "2.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true,
"optional": true
},
"sax": {
"version": "1.2.4",
"bundled": true,
"resolved": false,
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true,
"optional": true
},
"semver": {
"version": "5.5.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
"dev": true,
"optional": true
},
"set-blocking": {
"version": "2.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true,
"optional": true
},
"signal-exit": {
"version": "3.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"dev": true,
"optional": true
},
"string-width": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@ -4661,7 +4745,8 @@
},
"string_decoder": {
"version": "1.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"dev": true,
"optional": true,
"requires": {
@ -4670,7 +4755,8 @@
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
@ -4678,13 +4764,15 @@
},
"strip-json-comments": {
"version": "2.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"dev": true,
"optional": true
},
"tar": {
"version": "4.4.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==",
"dev": true,
"optional": true,
"requires": {
@ -4699,13 +4787,15 @@
},
"util-deprecate": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"dev": true,
"optional": true
},
"wide-align": {
"version": "1.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==",
"dev": true,
"optional": true,
"requires": {
@ -4714,12 +4804,14 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=",
"dev": true
}
}
@ -4894,18 +4986,6 @@
"ini": "^1.3.2"
}
},
"github": {
"version": "9.3.1",
"resolved": "https://registry.npmjs.org/github/-/github-9.3.1.tgz",
"integrity": "sha1-ajxanMKhzQtdCXpHuu+50Ryu+J4=",
"dev": true,
"requires": {
"follow-redirects": "0.0.7",
"https-proxy-agent": "^1.0.0",
"mime": "^1.2.11",
"netrc": "^0.1.4"
}
},
"glob": {
"version": "6.0.4",
"resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
@ -5285,17 +5365,6 @@
"integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=",
"dev": true
},
"https-proxy-agent": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz",
"integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=",
"dev": true,
"requires": {
"agent-base": "2",
"debug": "2",
"extend": "3"
}
},
"husky": {
"version": "0.14.3",
"resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz",
@ -6344,6 +6413,12 @@
"integrity": "sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM=",
"dev": true
},
"lodash.get": {
"version": "4.4.2",
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
"integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=",
"dev": true
},
"lodash.isempty": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz",
@ -6398,6 +6473,12 @@
"integrity": "sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU=",
"dev": true
},
"lodash.set": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz",
"integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=",
"dev": true
},
"lodash.some": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/lodash.some/-/lodash.some-4.6.0.tgz",
@ -6429,6 +6510,12 @@
"integrity": "sha1-EjBkIvYzJK7YSD0/ODMrX2cFR6A=",
"dev": true
},
"lodash.uniq": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
"integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=",
"dev": true
},
"log-symbols": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-1.0.2.tgz",
@ -6493,6 +6580,12 @@
}
}
},
"macos-release": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.0.0.tgz",
"integrity": "sha512-iCM3ZGeqIzlrH7KxYK+fphlJpCCczyHXc+HhRVbEu9uNTCrzYJjvvtefzeKTCVHd5AP/aD/fzC80JZ4ZP+dQ/A==",
"dev": true
},
"make-dir": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
@ -6877,12 +6970,6 @@
"brorand": "^1.0.1"
}
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"dev": true
},
"mime-db": {
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
@ -7152,12 +7239,6 @@
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=",
"dev": true
},
"netrc": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/netrc/-/netrc-0.1.4.tgz",
"integrity": "sha1-a+lPysqNd63gqWcNxGCRTJRHJEQ=",
"dev": true
},
"nice-try": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
@ -7365,6 +7446,12 @@
"object-assign": "^4.1.1"
}
},
"octokit-pagination-methods": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz",
"integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==",
"dev": true
},
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
@ -7473,6 +7560,16 @@
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true
},
"os-name": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/os-name/-/os-name-3.0.0.tgz",
"integrity": "sha512-7c74tib2FsdFbQ3W+qj8Tyd1R3Z6tuVRNNxXjJcZ4NgjIEQU9N/prVMqcW29XZPXGACqaXN3jq58/6hoaoXH6g==",
"dev": true,
"requires": {
"macos-release": "^2.0.0",
"windows-release": "^3.1.0"
}
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
@ -10384,12 +10481,6 @@
}
}
},
"stream-consume": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.1.tgz",
"integrity": "sha512-tNa3hzgkjEP7XbCkbRXe1jpg+ievoa0O4SCFlMOYEscGSS4JJsckGL8swUyAa/ApGU3Ae4t6Honor4HhL+tRyg==",
"dev": true
},
"stream-http": {
"version": "2.8.2",
"resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.2.tgz",
@ -11446,6 +11537,15 @@
"unist-util-is": "^2.1.1"
}
},
"universal-user-agent": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.0.2.tgz",
"integrity": "sha512-nOwvHWLH3dBazyuzbECPA5uVFNd7AlgviXRHgR4yf48QqitIvpdncRrxMbZNMpPPEfgz30I9ubd1XmiJiqsTrg==",
"dev": true,
"requires": {
"os-name": "^3.0.0"
}
},
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
@ -11640,6 +11740,12 @@
"prepend-http": "^1.0.1"
}
},
"url-template": {
"version": "2.0.8",
"resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz",
"integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=",
"dev": true
},
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
@ -11868,6 +11974,45 @@
"dev": true,
"optional": true
},
"windows-release": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.1.0.tgz",
"integrity": "sha512-hBb7m7acFgQPQc222uEQTmdcGLeBmQLNLFIh0rDk3CwFOBrfjefLzEfEfmpMq8Af/n/GnFf3eYf203FY1PmudA==",
"dev": true,
"requires": {
"execa": "^0.10.0"
},
"dependencies": {
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"execa": {
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz",
"integrity": "sha512-7XOMnz8Ynx1gGo/3hyV9loYNPWM94jG3+3T3Y8tsfSstFmETmENCMU/A/zj8Lyaj1lkgEepKepvd6240tBRvlw==",
"dev": true,
"requires": {
"cross-spawn": "^6.0.0",
"get-stream": "^3.0.0",
"is-stream": "^1.1.0",
"npm-run-path": "^2.0.0",
"p-finally": "^1.0.0",
"signal-exit": "^3.0.0",
"strip-eof": "^1.0.0"
}
}
}
},
"wordwrap": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
@ -11968,4 +12113,4 @@
"dev": true
}
}
}
}

Просмотреть файл

@ -18,7 +18,7 @@
"eslint-config-standard": "^12.0.0",
"eslint-plugin-mocha": "^5.2.0",
"folder-hash": "^2.1.1",
"github": "^9.2.0",
"@octokit/rest": "^16.3.2",
"html-entities": "^1.2.1",
"husky": "^0.14.3",
"lint": "^1.1.2",
@ -73,4 +73,4 @@
"@electron/internal/(.+)": "./lib/$1"
}
}
}
}

Просмотреть файл

@ -1,7 +1,6 @@
if (!process.env.CI) require('dotenv-safe').load()
const GitHub = require('github')
const github = new GitHub()
const octokit = require('@octokit/rest')()
if (process.argv.length < 3) {
console.log('Usage: find-release version')
@ -11,14 +10,14 @@ if (process.argv.length < 3) {
const version = process.argv[2]
async function findRelease () {
github.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
const releases = await github.repos.getReleases({
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
const releases = await octokit.repos.listReleases({
owner: 'electron',
repo: version.indexOf('nightly') > 0 ? 'nightlies' : 'electron'
})
const targetRelease = releases.data.find(release => {
return release.tag_name === version
})
const targetRelease = releases.data.find(release => release.tag_name === version)
let returnObject = {}
if (targetRelease) {

Просмотреть файл

@ -5,7 +5,7 @@ const args = require('minimist')(process.argv.slice(2), {
boolean: ['automaticRelease', 'notesOnly', 'stable']
})
const ciReleaseBuild = require('./ci-release-build')
const GitHub = require('github')
const octokit = require('@octokit/rest')()
const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
@ -20,18 +20,14 @@ require('colors')
const pass = '\u2713'.green
const fail = '\u2717'.red
// TODO (future) automatically determine version based on conventional commits
// via conventional-recommended-bump
if (!bumpType && !args.notesOnly) {
console.log(`Usage: prepare-release [stable | beta | nightly]` +
` (--stable) (--notesOnly) (--automaticRelease) (--branch)`)
process.exit(1)
}
const github = new GitHub()
const gitDir = path.resolve(__dirname, '..')
github.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
async function getNewVersion (dryRun) {
if (!dryRun) {
@ -70,15 +66,15 @@ async function createRelease (branchToTarget, isBeta) {
const releaseNotes = await getReleaseNotes(branchToTarget)
const newVersion = await getNewVersion()
await tagRelease(newVersion)
const githubOpts = {
console.log(`Checking for existing draft release.`)
const releases = await octokit.repos.listReleases({
owner: 'electron',
repo: targetRepo
}
console.log(`Checking for existing draft release.`)
const releases = await github.repos.getReleases(githubOpts)
.catch(err => {
console.log(`${fail} Could not get releases. Error was: `, err)
})
}).catch(err => {
console.log(`${fail} Could not get releases. Error was: `, err)
})
const drafts = releases.data.filter(release => release.draft &&
release.tag_name === newVersion)
if (drafts.length > 0) {
@ -87,32 +83,40 @@ async function createRelease (branchToTarget, isBeta) {
process.exit(1)
}
console.log(`${pass} A draft release does not exist; creating one.`)
githubOpts.draft = true
githubOpts.name = `electron ${newVersion}`
let releaseBody
let releaseIsPrelease = false
if (isBeta) {
if (newVersion.indexOf('nightly') > 0) {
githubOpts.body = `Note: This is a nightly release. Please file new issues ` +
releaseBody = `Note: This is a nightly release. Please file new issues ` +
`for any bugs you find in it.\n \n This release is published to npm ` +
`under the nightly tag and can be installed via npm install electron@nightly, ` +
`or npm i electron@${newVersion.substr(1)}.\n \n ${releaseNotes.text}`
} else {
githubOpts.body = `Note: This is a beta release. Please file new issues ` +
releaseBody = `Note: This is a beta release. Please file new issues ` +
`for any bugs you find in it.\n \n This release is published to npm ` +
`under the beta tag and can be installed via npm install electron@beta, ` +
`or npm i electron@${newVersion.substr(1)}.\n \n ${releaseNotes.text}`
}
githubOpts.name = `${githubOpts.name}`
githubOpts.prerelease = true
releaseIsPrelease = true
} else {
githubOpts.body = releaseNotes
releaseBody = releaseNotes
}
githubOpts.tag_name = newVersion
githubOpts.target_commitish = newVersion.indexOf('nightly') !== -1 ? 'master' : branchToTarget
const release = await github.repos.createRelease(githubOpts)
.catch(err => {
console.log(`${fail} Error creating new release: `, err)
process.exit(1)
})
const release = await octokit.repos.createRelease({
owner: 'electron',
repo: targetRepo,
tag_name: newVersion,
draft: true,
name: `electron ${newVersion}`,
body: releaseBody,
prerelease: releaseIsPrelease,
target_commitish: newVersion.indexOf('nightly') !== -1 ? 'master' : branchToTarget
}).catch(err => {
console.log(`${fail} Error creating new release: `, err)
process.exit(1)
})
console.log(`Release has been created with id: ${release.data.id}.`)
console.log(`${pass} Draft release for ${newVersion} successful.`)
}
@ -123,8 +127,7 @@ async function pushRelease (branch) {
console.log(`${pass} Successfully pushed the release. Wait for ` +
`release builds to finish before running "npm run release".`)
} else {
console.log(`${fail} Error pushing the release: ` +
`${pushDetails.stderr}`)
console.log(`${fail} Error pushing the release: ${pushDetails.stderr}`)
process.exit(1)
}
}

Просмотреть файл

@ -2,23 +2,19 @@ const temp = require('temp')
const fs = require('fs')
const path = require('path')
const childProcess = require('child_process')
const GitHubApi = require('github')
const { getCurrentBranch } = require('./lib/utils.js')
const request = require('request')
const semver = require('semver')
const rootPackageJson = require('../package.json')
const octokit = require('@octokit/rest')({
headers: { 'User-Agent': 'electron-npm-publisher' }
})
if (!process.env.ELECTRON_NPM_OTP) {
console.error('Please set ELECTRON_NPM_OTP')
process.exit(1)
}
const github = new GitHubApi({
// debug: true,
headers: { 'User-Agent': 'electron-npm-publisher' },
followRedirects: false
})
let tempDir
temp.track() // track and cleanup files at exit
@ -72,7 +68,7 @@ new Promise((resolve, reject) => {
JSON.stringify(packageJson, null, 2)
)
return github.repos.getReleases({
return octokit.repos.listReleases({
owner: 'electron',
repo: rootPackageJson.version.indexOf('nightly') > 0 ? 'nightlies' : 'electron'
})

Просмотреть файл

@ -12,13 +12,12 @@ const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
const { getCurrentBranch } = require('./lib/utils.js')
const GitHub = require('github')
const octokit = require('@octokit/rest')()
const path = require('path')
const github = new GitHub()
const gitDir = path.resolve(__dirname, '..')
github.authenticate({
octokit.authenticate({
type: 'token',
token: process.env.ELECTRON_GITHUB_TOKEN
})
@ -44,17 +43,17 @@ async function revertBumpCommit (tag) {
async function deleteDraft (releaseId, targetRepo) {
try {
const result = await github.repos.getRelease({
const result = await octokit.repos.getRelease({
owner: 'electron',
repo: targetRepo,
id: parseInt(releaseId, 10)
release_id: parseInt(releaseId, 10)
})
console.log(result)
if (!result.data.draft) {
console.log(`${fail} published releases cannot be deleted.`)
return false
} else {
await github.repos.deleteRelease({
await octokit.repos.deleteRelease({
owner: 'electron',
repo: targetRepo,
release_id: result.data.id
@ -70,7 +69,7 @@ async function deleteDraft (releaseId, targetRepo) {
async function deleteTag (tag, targetRepo) {
try {
await github.gitdata.deleteReference({
await octokit.git.deleteRef({
owner: 'electron',
repo: targetRepo,
ref: tag

Просмотреть файл

@ -13,7 +13,6 @@ const args = require('minimist')(process.argv.slice(2), {
})
const fs = require('fs')
const { execSync } = require('child_process')
const GitHub = require('github')
const nugget = require('nugget')
const pkg = require('../package.json')
const pkgVersion = `v${pkg.version}`
@ -23,25 +22,27 @@ const fail = '\u2717'.red
const sumchecker = require('sumchecker')
const temp = require('temp').track()
const { URL } = require('url')
const octokit = require('@octokit/rest')()
octokit.authenticate({
type: 'token',
token: process.env.ELECTRON_GITHUB_TOKEN
})
const targetRepo = pkgVersion.indexOf('nightly') > 0 ? 'nightlies' : 'electron'
let failureCount = 0
const github = new GitHub({
followRedirects: false
})
github.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
async function getDraftRelease (version, skipValidation) {
const releaseInfo = await github.repos.getReleases({ owner: 'electron', repo: targetRepo })
let versionToCheck
if (version) {
versionToCheck = version
} else {
versionToCheck = pkgVersion
}
const drafts = releaseInfo.data
.filter(release => release.tag_name === versionToCheck &&
release.draft === true)
const releaseInfo = await octokit.repos.listReleases({
owner: 'electron',
repo: targetRepo
})
const versionToCheck = version || pkgVersion
const drafts = releaseInfo.data.filter(release => {
return release.tag_name === versionToCheck && release.draft === true
})
const draft = drafts[0]
if (!skipValidation) {
failureCount = 0
@ -165,9 +166,7 @@ function runScript (scriptName, scriptArgs, cwd) {
const scriptOptions = {
encoding: 'UTF-8'
}
if (cwd) {
scriptOptions.cwd = cwd
}
if (cwd) scriptOptions.cwd = cwd
try {
return execSync(scriptCommand, scriptOptions)
} catch (err) {
@ -195,10 +194,10 @@ async function createReleaseShasums (release) {
const existingAssets = release.assets.filter(asset => asset.name === fileName)
if (existingAssets.length > 0) {
console.log(`${fileName} already exists on GitHub; deleting before creating new file.`)
await github.repos.deleteAsset({
await octokit.repos.deleteReleaseAsset({
owner: 'electron',
repo: targetRepo,
id: existingAssets[0].id
asset_id: existingAssets[0].id
}).catch(err => {
console.log(`${fail} Error deleting ${fileName} on GitHub:`, err)
})
@ -206,26 +205,30 @@ async function createReleaseShasums (release) {
console.log(`Creating and uploading the release ${fileName}.`)
const scriptPath = path.join(__dirname, 'merge-electron-checksums.py')
const checksums = runScript(scriptPath, ['-v', pkgVersion])
console.log(`${pass} Generated release SHASUMS.`)
const filePath = await saveShaSumFile(checksums, fileName)
console.log(`${pass} Created ${fileName} file.`)
await uploadShasumFile(filePath, fileName, release)
await uploadShasumFile(filePath, fileName, release.id)
console.log(`${pass} Successfully uploaded ${fileName} to GitHub.`)
}
async function uploadShasumFile (filePath, fileName, release) {
const githubOpts = {
owner: 'electron',
repo: targetRepo,
id: release.id,
filePath,
async function uploadShasumFile (filePath, fileName, releaseId) {
const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/releases/${releaseId}/assets{?name,label}`
return octokit.repos.uploadReleaseAsset({
url: uploadUrl,
headers: {
'content-type': 'text/plain',
'content-size': fs.statSync(filePath).size
},
file: fs.createReadStream(filePath),
name: fileName
}
return github.repos.uploadAsset(githubOpts)
.catch(err => {
console.log(`${fail} Error uploading ${filePath} to GitHub:`, err)
process.exit(1)
})
}).catch(err => {
console.log(`${fail} Error uploading ${filePath} to GitHub:`, err)
process.exit(1)
})
}
function saveShaSumFile (checksums, fileName) {
@ -249,18 +252,16 @@ function saveShaSumFile (checksums, fileName) {
}
async function publishRelease (release) {
const githubOpts = {
return octokit.repos.updateRelease({
owner: 'electron',
repo: targetRepo,
id: release.id,
release_id: release.id,
tag_name: release.tag_name,
draft: false
}
return github.repos.editRelease(githubOpts)
.catch(err => {
console.log(`${fail} Error publishing release:`, err)
process.exit(1)
})
}).catch(err => {
console.log(`${fail} Error publishing release:`, err)
process.exit(1)
})
}
async function makeRelease (releaseToValidate) {
@ -280,6 +281,7 @@ async function makeRelease (releaseToValidate) {
uploadIndexJson()
await createReleaseShasums(draftRelease)
// Fetch latest version of release before verifying
draftRelease = await getDraftRelease(pkgVersion, true)
await validateReleaseAssets(draftRelease)
@ -303,24 +305,26 @@ async function makeTempDir () {
async function verifyAssets (release) {
const downloadDir = await makeTempDir()
const githubOpts = {
owner: 'electron',
repo: targetRepo,
headers: {
Accept: 'application/octet-stream'
}
}
console.log(`Downloading files from GitHub to verify shasums`)
const shaSumFile = 'SHASUMS256.txt'
let filesToCheck = await Promise.all(release.assets.map(async (asset) => {
githubOpts.id = asset.id
const assetDetails = await github.repos.getAsset(githubOpts)
let filesToCheck = await Promise.all(release.assets.map(async asset => {
const assetDetails = await octokit.repos.getReleaseAsset({
owner: 'electron',
repo: targetRepo,
asset_id: asset.id,
headers: {
Accept: 'application/octet-stream'
}
})
await downloadFiles(assetDetails.meta.location, downloadDir, asset.name)
return asset.name
})).catch(err => {
console.log(`${fail} Error downloading files from GitHub`, err)
process.exit(1)
})
filesToCheck = filesToCheck.filter(fileName => fileName !== shaSumFile)
let checkerOpts
await validateChecksums({

Просмотреть файл

@ -1,7 +1,5 @@
const cp = require('child_process')
const utils = require('./lib/utils')
const electronPath = utils.getAbsoluteElectronExec()
const child = cp.spawn(electronPath, process.argv.slice(2), { stdio: 'inherit' })

Просмотреть файл

@ -1,48 +1,68 @@
if (!process.env.CI) require('dotenv-safe').load()
const GitHub = require('github')
const github = new GitHub()
github.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
const fs = require('fs')
const octokit = require('@octokit/rest')()
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
if (process.argv.length < 6) {
console.log('Usage: upload-to-github filePath fileName releaseId')
process.exit(1)
}
const filePath = process.argv[2]
const fileName = process.argv[3]
const releaseId = process.argv[4]
const releaseVersion = process.argv[5]
const targetRepo = releaseVersion.indexOf('nightly') > 0 ? 'nightlies' : 'electron'
const getHeaders = (filePath, fileName) => {
const extension = fileName.split('.').pop()
const size = fs.statSync(filePath).size
const options = {
'json': 'text/json',
'zip': 'application/zip',
'txt': 'text/plain'
}
const githubOpts = {
owner: 'electron',
repo: targetRepo,
id: releaseId,
filePath: filePath,
name: fileName
return {
'content-type': options[extension],
'content-length': size
}
}
const targetRepo = releaseVersion.indexOf('nightly') > 0 ? 'nightlies' : 'electron'
const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/releases/${releaseId}/assets{?name,label}`
let retry = 0
function uploadToGitHub () {
github.repos.uploadAsset(githubOpts).then(() => {
octokit.repos.uploadReleaseAsset({
url: uploadUrl,
headers: getHeaders(filePath, fileName),
file: fs.createReadStream(filePath),
name: fileName
}).then(() => {
console.log(`Successfully uploaded ${fileName} to GitHub.`)
process.exit()
}).catch((err) => {
if (retry < 4) {
console.log(`Error uploading ${fileName} to GitHub, will retry. Error was:`, err)
retry++
github.repos.getRelease(githubOpts).then(release => {
octokit.repos.listAssetsForRelease({
owner: 'electron',
repo: targetRepo,
release_id: releaseId
}).then(assets => {
console.log('Got list of assets for existing release:')
console.log(JSON.stringify(release.data.assets, null, ' '))
const existingAssets = release.data.assets.filter(asset => asset.name === fileName)
console.log(JSON.stringify(assets.data, null, ' '))
const existingAssets = assets.data.filter(asset => asset.name === fileName)
if (existingAssets.length > 0) {
console.log(`${fileName} already exists; will delete before retrying upload.`)
github.repos.deleteAsset({
octokit.repos.deleteReleaseAsset({
owner: 'electron',
repo: targetRepo,
id: existingAssets[0].id
asset_id: existingAssets[0].id
}).catch((deleteErr) => {
console.log(`Failed to delete existing asset ${fileName}. Error was:`, deleteErr)
}).then(uploadToGitHub)