support local

This commit is contained in:
Opportunity
2020-07-17 11:45:52 +08:00
Unverified
parent bff8013f3d
commit fad1ce1d16
27 changed files with 581 additions and 322 deletions
+5 -3
View File
@@ -5,9 +5,9 @@ import * as toolCache from '@actions/tool-cache';
import * as os from 'os';
import * as path from 'path';
import * as semver from 'semver';
import { Version } from './interfaces';
import { Version, GitVersion } from './interfaces';
function getInstallerUrl(version: Version): string {
function getInstallerUrl(version: GitVersion): string {
const ver = version.version;
switch (version.type) {
case 'heads': {
@@ -30,7 +30,6 @@ function getInstallerUrl(version: Version): string {
}
default: {
// check that we have tested all types
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _: never = version.type;
throw new Error('Unknown version type');
}
@@ -38,6 +37,9 @@ function getInstallerUrl(version: Version): string {
}
export async function winInstall(version: Version): Promise<void> {
if (version.type === 'local') {
throw new Error('Local builds for windows is not supported');
}
const ver = version.version;
let toolDir = toolCache.find('xmake', ver);
if (!toolDir) {