File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { Octokit } from '@octokit/rest' ;
2
2
import semver from 'semver' ;
3
3
4
+ /**
5
+ * The repo we are working on.
6
+ */
4
7
const REPO = Object . freeze ( {
5
8
owner : 'mongodb-js' ,
6
9
repo : 'mongosh'
7
10
} ) ;
8
11
12
+ /**
13
+ * Determine if this version is releasable.
14
+ *
15
+ * @param {string } version - The current version.
16
+ * @param {Octokit } octokit - The octokit instance.
17
+ *
18
+ * @returns {Promise } The promise of the boolean.
19
+ */
9
20
const isReleasable = async ( version : string , octokit : Octokit ) : Promise < boolean > => {
10
21
const latestRelease = await getLatestRelease ( octokit ) ;
11
22
return semver . gt ( version , latestRelease . tag_name . replace ( 'v' , '' ) ) ;
@@ -27,7 +38,7 @@ const getLatestRelease = async(octokit: Octokit): Promise<any> => {
27
38
return data ;
28
39
} ;
29
40
30
- const createRelease = ( version : string , octokit : Octokit ) => {
41
+ const createRelease = ( version : string , octokit : Octokit ) : Promise < any > => {
31
42
const params = {
32
43
...REPO ,
33
44
tag_name : `v${ version } ` ,
@@ -37,7 +48,7 @@ const createRelease = (version: string, octokit: Octokit) => {
37
48
return octokit . repos . createRelease ( params ) ;
38
49
} ;
39
50
40
- const uploadAsset = ( artifact : string , octokit : Octokit ) => {
51
+ const uploadAsset = ( artifact : string , octokit : Octokit ) : Promise < any > => {
41
52
const params = {
42
53
...REPO ,
43
54
release_id : 1 ,
You can’t perform that action at this time.
0 commit comments