Skip to content

Commit 48cd197

Browse files
committed
Updating github types
1 parent ed937ac commit 48cd197

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

packages/build/src/github.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import { Octokit } from '@octokit/rest';
2+
import {
3+
GetResponseTypeFromEndpointMethod,
4+
GetResponseDataTypeFromEndpointMethod,
5+
} from "@octokit/types";
26
import semver from 'semver';
37

48
/**
@@ -38,6 +42,12 @@ const getLatestRelease = async(octokit: Octokit): Promise<any> => {
3842
return data;
3943
};
4044

45+
/**
46+
* Create a new release.
47+
*
48+
* @param {string} version - The release version.
49+
* @param {Octokit} octokit - The octokit instance.
50+
*/
4151
const createRelease = (version: string, octokit: Octokit): Promise<any> => {
4252
const params = {
4353
...REPO,
@@ -48,10 +58,15 @@ const createRelease = (version: string, octokit: Octokit): Promise<any> => {
4858
return octokit.repos.createRelease(params);
4959
};
5060

51-
const uploadAsset = (artifact: string, octokit: Octokit): Promise<any> => {
61+
/**
62+
* Upload the asset to the release.
63+
*
64+
*
65+
*/
66+
const uploadAsset = (artifact: string, releaseId: number, octokit: Octokit): Promise<any> => {
5267
const params = {
5368
...REPO,
54-
release_id: 1,
69+
release_id: releaseId,
5570
data: ''
5671
};
5772
return octokit.repos.uploadReleaseAsset(params);

packages/build/src/release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const release = async(config: Config) => {
4747

4848
if (await isReleasable(config.version, octokit)) {
4949
const releaseId = await createRelease(config.version, octokit);
50-
await uploadAsset(artifact, octokit);
50+
await uploadAsset(artifact, releaseId, octokit);
5151

5252
// - Publish the .deb (only on linux)
5353
// - Publish the .rpm (only on linux)

0 commit comments

Comments
 (0)