Use native tools

This commit is contained in:
CrazyMax
2020-05-06 22:14:50 +02:00
parent 232b78f307
commit 6395a3aa2f
6 changed files with 75 additions and 875 deletions

12
src/github.ts Normal file
View File

@@ -0,0 +1,12 @@
import * as httpm from '@actions/http-client';
export interface GitHubRelease {
id: number;
tag_name: string;
}
export const getRelease = async (version: string): Promise<GitHubRelease | null> => {
const url: string = `https://github.com/upx/upx/releases/${version !== 'latest' ? `v${version}` : version}`;
const http: httpm.HttpClient = new httpm.HttpClient('ghaction-upx');
return (await http.getJson<GitHubRelease>(url)).result;
};