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
+37 -28
View File
@@ -1,34 +1,43 @@
root: true root: true
parser: '@typescript-eslint/parser' parser: '@typescript-eslint/parser'
parserOptions: parserOptions:
project: tsconfig.json project: tsconfig.json
plugins: plugins:
- '@typescript-eslint' - '@typescript-eslint'
- prettier - prettier
extends: extends:
- eslint:recommended - eslint:recommended
- plugin:@typescript-eslint/eslint-recommended - plugin:@typescript-eslint/recommended
- plugin:@typescript-eslint/recommended - plugin:@typescript-eslint/recommended-requiring-type-checking
- plugin:@typescript-eslint/recommended-requiring-type-checking - prettier
- prettier/@typescript-eslint - prettier/@typescript-eslint
- plugin:prettier/recommended - plugin:prettier/recommended
rules: rules:
'prettier/prettier': [1] 'prettier/prettier': [1]
'@typescript-eslint/array-type': [1, { default: array-simple }] '@typescript-eslint/array-type': [1, { default: array-simple }]
'@typescript-eslint/explicit-function-return-type': [2, { allowExpressions: true }] '@typescript-eslint/explicit-function-return-type':
'@typescript-eslint/no-extra-non-null-assertion': [2] - 2
'@typescript-eslint/no-extraneous-class': [1, { allowWithDecorator: true, allowStaticOnly: true }] - allowExpressions: true
'@typescript-eslint/no-floating-promises': [1] '@typescript-eslint/no-extraneous-class':
'@typescript-eslint/no-parameter-properties': - 1
- 1 - allowWithDecorator: true
- allows: allowStaticOnly: true
- protected readonly '@typescript-eslint/no-parameter-properties':
- private readonly - 1
- public readonly - allows: [protected readonly, private readonly, public readonly, readonly]
- readonly '@typescript-eslint/no-throw-literal': [2]
'@typescript-eslint/no-throw-literal': [2] 'no-unused-vars': [0]
'no-unused-vars': [0] '@typescript-eslint/no-unused-vars':
'@typescript-eslint/prefer-for-of': [1] - 1
'@typescript-eslint/prefer-function-type': [1] - varsIgnorePattern: ^_
'@typescript-eslint/prefer-nullish-coalescing': [1] argsIgnorePattern: ^_
'@typescript-eslint/prefer-optional-chain': [1] '@typescript-eslint/prefer-for-of': [1]
'@typescript-eslint/prefer-function-type': [1]
'@typescript-eslint/prefer-nullish-coalescing': [1]
'@typescript-eslint/prefer-optional-chain': [1]
'@typescript-eslint/ban-types':
- 1
- types:
object: false
no-void: [1, { allowAsStatement: true }]
eqeqeq: [1, smart]
+22 -22
View File
@@ -1,28 +1,28 @@
name: checkin name: checkin
on: on:
- push - push
- pull_request - pull_request
jobs: jobs:
checkin: checkin:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: install - name: install
run: yarn install run: yarn install
- name: build - name: build
run: yarn build run: yarn build
- name: test - name: test
run: yarn test run: yarn test
- name: release - name: release
run: yarn release run: yarn release
- name: 'check for uncommitted changes' - name: 'check for uncommitted changes'
# Ensure no changes # Ensure no changes
run: | run: |
git add . git add .
if ! git diff --cached --color=always --exit-code -- . ':!node_modules'; then if ! git diff --cached --color=always --exit-code -- . ':!node_modules'; then
echo "::error::Found changed files after build. Please run 'yarn release' and check in all changes." echo "::error::Found changed files after build. Please run 'yarn release' and check in all changes."
exit 1 exit 1
fi fi
+17 -17
View File
@@ -1,24 +1,24 @@
name: test name: test
on: on:
- push - push
jobs: jobs:
build: build:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macOS-latest] os: [ubuntu-latest, windows-latest, macOS-latest]
version: [latest, branch@master] version: [latest, branch@master]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: xmake-io/github-action-setup-xmake@master - uses: xmake-io/github-action-setup-xmake@master
with: with:
xmake-version: ${{ matrix.version }} xmake-version: ${{ matrix.version }}
- name: Run tests - name: Run tests
run: | run: |
xmake create -P test xmake create -P test
xmake build -P test xmake build -P test
xmake run -P test xmake run -P test
+7 -1
View File
@@ -1,5 +1,11 @@
singleQuote: true singleQuote: true
trailingComma: all trailingComma: all
tabWidth: 4 tabWidth: 2
endOfLine: lf endOfLine: lf
printWidth: 120 printWidth: 120
overrides:
- files:
- '*.js'
- '*.ts'
options:
tabWidth: 4
+17 -17
View File
@@ -1,19 +1,19 @@
{ {
"npm.packageManager": "yarn", "npm.packageManager": "yarn",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"], "eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact", "vue"],
"eslint.enable": true, "eslint.enable": true,
"files.autoSave": "off", "files.autoSave": "off",
"eslint.format.enable": true, "eslint.format.enable": true,
"editor.tabSize": 4, "editor.tabSize": 4,
"editor.formatOnSave": false, "editor.formatOnSave": false,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true "source.fixAll.eslint": true
}, },
"[typescript]": { "[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint" "editor.defaultFormatter": "dbaeumer.vscode-eslint"
}, },
"[javascript]": { "[javascript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint" "editor.defaultFormatter": "dbaeumer.vscode-eslint"
}, },
"git.ignoreLimitWarning": true "git.ignoreLimitWarning": true
} }
+4 -4
View File
@@ -16,7 +16,7 @@ Use latest version:
```yml ```yml
uses: xmake-io/github-action-setup-xmake@v1 uses: xmake-io/github-action-setup-xmake@v1
with: with:
xmake-version: latest xmake-version: latest
``` ```
Use specified version: Use specified version:
@@ -24,7 +24,7 @@ Use specified version:
```yml ```yml
uses: xmake-io/github-action-setup-xmake@v1 uses: xmake-io/github-action-setup-xmake@v1
with: with:
xmake-version: '2.3.1' xmake-version: '2.3.1'
``` ```
Use specified branch: Use specified branch:
@@ -32,7 +32,7 @@ Use specified branch:
```yml ```yml
uses: xmake-io/github-action-setup-xmake@v1 uses: xmake-io/github-action-setup-xmake@v1
with: with:
xmake-version: branch@master xmake-version: branch@master
``` ```
Use semver: Use semver:
@@ -40,5 +40,5 @@ Use semver:
```yml ```yml
uses: xmake-io/github-action-setup-xmake@v1 uses: xmake-io/github-action-setup-xmake@v1
with: with:
xmake-version: '>=2.2.6 <=2.3.1' xmake-version: '>=2.2.6 <=2.3.1'
``` ```
+8 -8
View File
@@ -2,15 +2,15 @@ name: setup xmake
description: Set up a xmake environment and add it to the PATH description: Set up a xmake environment and add it to the PATH
author: OpportunityLiu author: OpportunityLiu
branding: branding:
icon: play icon: play
color: green color: green
inputs: inputs:
xmake-version: xmake-version:
required: true required: true
default: latest default: latest
description: The version to use. Should be a semver range or 'latest'. Or use [{repository}#]branch@{branch_name} to select a branch. description: The version to use. Should be a semver range or 'latest'. Or use [{repository}#]branch@{branch_name} to select a branch.
runs: runs:
using: 'node12' using: 'node12'
main: 'dist/index.js' main: 'dist/index.js'
Vendored
+24 -10
View File
@@ -1,10 +1,29 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.cleanup = exports.create = exports.lsRemote = void 0; exports.cleanup = exports.create = exports.lsRemote = void 0;
const exec_1 = require("@actions/exec"); const exec_1 = require("@actions/exec");
const io = require("@actions/io"); const io = __importStar(require("@actions/io"));
const os = require("os"); const os = __importStar(require("os"));
const path = require("path"); const path = __importStar(require("path"));
function makeOpt(ref) { function makeOpt(ref) {
return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) }; return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) };
} }
@@ -22,21 +41,16 @@ async function lsRemote(repo) {
const [ref, tag] = line.trim().split('\t'); const [ref, tag] = line.trim().split('\t');
if (ref && tag && tag.startsWith('refs/')) { if (ref && tag && tag.startsWith('refs/')) {
const tagPath = tag.split('/').splice(1); const tagPath = tag.split('/').splice(1);
// eslint-disable-next-line @typescript-eslint/no-explicit-any let ldata = data;
let ldata = data; // eslint-disable-line @typescript-eslint/no-unsafe-assignment
for (let i = 0; i < tagPath.length - 1; i++) { for (let i = 0; i < tagPath.length - 1; i++) {
const seg = tagPath[i]; const seg = tagPath[i];
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if (typeof ldata[seg] === 'object') { if (typeof ldata[seg] === 'object') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access ldata = ldata[seg];
ldata = ldata[seg]; // eslint-disable-line @typescript-eslint/no-unsafe-assignment
} }
else { else {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata = ldata[seg] = {}; ldata = ldata[seg] = {};
} }
} }
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
ldata[tagPath[tagPath.length - 1]] = ref; ldata[tagPath[tagPath.length - 1]] = ref;
} }
}); });
+21 -2
View File
@@ -1,8 +1,27 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const core = require("@actions/core"); const core = __importStar(require("@actions/core"));
const exec_1 = require("@actions/exec"); const exec_1 = require("@actions/exec");
const os = require("os"); const os = __importStar(require("os"));
const versions_1 = require("./versions"); const versions_1 = require("./versions");
const win_install_1 = require("./win-install"); const win_install_1 = require("./win-install");
const unix_install_1 = require("./unix-install"); const unix_install_1 = require("./unix-install");
+59 -25
View File
@@ -1,35 +1,69 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.unixInstall = void 0; exports.unixInstall = void 0;
const core = require("@actions/core"); const core_1 = __importDefault(require("@actions/core"));
const exec_1 = require("@actions/exec"); const exec_1 = require("@actions/exec");
const io = require("@actions/io"); const io_1 = __importDefault(require("@actions/io"));
const toolCache = require("@actions/tool-cache"); const tool_cache_1 = __importDefault(require("@actions/tool-cache"));
const os = require("os"); const os_1 = __importDefault(require("os"));
const path = require("path"); const path_1 = __importDefault(require("path"));
const semver = require("semver"); const semver_1 = __importDefault(require("semver"));
const git = require("./git"); const git = __importStar(require("./git"));
async function install(sourceDir, binDir) {
await exec_1.exec('make', ['build'], { cwd: sourceDir });
await exec_1.exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir });
}
async function unixInstall(version) { async function unixInstall(version) {
const ver = version.version; let toolDir;
let toolDir = toolCache.find('xmake', ver); if (version.type !== 'local') {
if (!toolDir) { const ver = version.version;
const sourceDir = await core.group(`download xmake ${String(version)}`, () => git.create(version.repo, version.sha)); toolDir = tool_cache_1.default.find('xmake', ver);
toolDir = await core.group(`install xmake ${String(version)}`, async () => { if (!toolDir) {
await exec_1.exec('make', ['build'], { cwd: sourceDir }); const sourceDir = await core_1.default.group(`download xmake ${String(version)}`, () => git.create(version.repo, version.sha));
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`); toolDir = await core_1.default.group(`install xmake ${String(version)}`, async () => {
await exec_1.exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir }); const binDir = path_1.default.join(os_1.default.tmpdir(), `xmake-${version.sha}`);
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver); await install(sourceDir, binDir);
await io.rmRF(binDir); const cacheDir = await tool_cache_1.default.cacheDir(binDir, 'xmake', ver);
await git.cleanup(version.sha); await io_1.default.rmRF(binDir);
return cacheDir; await git.cleanup(version.sha);
}); return cacheDir;
} });
// for versions 2.3.2 and above, xmake will be installed directly into the bin directory, and no script will be used to wrap it. }
if (version.type !== 'tags' || semver.gt(ver, '2.3.1')) {
core.addPath(path.join(toolDir, 'bin'));
} }
else { else {
core.addPath(path.join(toolDir, 'share', 'xmake')); // only for <= 2.3.1 toolDir = await core_1.default.group(`install local xmake at '${version.path}'`, async () => {
const binDir = path_1.default.join(os_1.default.tmpdir(), `xmake-${Date.now()}`);
await install(version.path, binDir);
return binDir;
});
}
if (version.type !== 'tags' || semver_1.default.gt(version.version, '2.3.1')) {
core_1.default.addPath(path_1.default.join(toolDir, 'bin'));
}
else {
core_1.default.addPath(path_1.default.join(toolDir, 'share', 'xmake'));
} }
} }
exports.unixInstall = unixInstall; exports.unixInstall = unixInstall;
+53 -20
View File
@@ -1,4 +1,23 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) { var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) { if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance"); throw new TypeError("attempted to set private field on non-instance");
@@ -12,13 +31,17 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
} }
return privateMap.get(receiver); return privateMap.get(receiver);
}; };
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _string; var _string;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.selectVersion = void 0; exports.selectVersion = void 0;
const core = require("@actions/core"); const core = __importStar(require("@actions/core"));
const semver = require("semver"); const semver_1 = __importDefault(require("semver"));
const git_1 = require("./git"); const git_1 = require("./git");
const interfaces_1 = require("./interfaces"); const interfaces_1 = require("./interfaces");
const path_1 = __importDefault(require("path"));
const DEFAULT_REPO = interfaces_1.Repo('xmake-io/xmake'); const DEFAULT_REPO = interfaces_1.Repo('xmake-io/xmake');
const VERSIONS = new Map(); const VERSIONS = new Map();
async function getVersions(repo) { async function getVersions(repo) {
@@ -29,7 +52,7 @@ async function getVersions(repo) {
VERSIONS.set(repo, result); VERSIONS.set(repo, result);
return result; return result;
} }
class VersionImpl { class GitVersionImpl {
constructor(repo, version, sha, type, toString) { constructor(repo, version, sha, type, toString) {
this.repo = repo; this.repo = repo;
this.version = version; this.version = version;
@@ -43,10 +66,17 @@ class VersionImpl {
} }
} }
_string = new WeakMap(); _string = new WeakMap();
class LocalVersionImpl {
constructor(path) {
this.path = path;
this.type = 'local';
this.path = path_1.default.resolve(path);
}
}
async function selectBranch(repo, branch) { async function selectBranch(repo, branch) {
const versions = await getVersions(repo); const versions = await getVersions(repo);
if (branch in versions.heads) { if (branch in versions.heads) {
return new VersionImpl(repo, branch, versions.heads[branch], 'heads', `branch ${branch}`); return new GitVersionImpl(repo, branch, versions.heads[branch], 'heads', `branch ${branch}`);
} }
throw new Error(`Branch ${branch} not found`); throw new Error(`Branch ${branch} not found`);
} }
@@ -54,27 +84,26 @@ async function selectPr(repo, pr) {
var _a; var _a;
const versions = await getVersions(repo); const versions = await getVersions(repo);
if (pr in versions.pull) { if (pr in versions.pull) {
const prheads = versions.pull[pr]; const prHeads = versions.pull[pr];
const sha = (_a = prheads.merge) !== null && _a !== void 0 ? _a : prheads.head; const sha = (_a = prHeads.merge) !== null && _a !== void 0 ? _a : prHeads.head;
if (sha) { if (sha) {
return new VersionImpl(repo, `pr#${pr}`, sha, 'pull', `pull request #${pr}`); return new GitVersionImpl(repo, `pr#${pr}`, sha, 'pull', `pull request #${pr}`);
} }
} }
throw new Error(`Pull requrest #${pr} not found`); throw new Error(`Pull requrest #${pr} not found`);
} }
async function selectSemver(repo, version) { async function selectSemver(repo, version) {
// check version valid const v = new semver_1.default.Range(version);
const v = new semver.Range(version);
if (!v) { if (!v) {
throw new Error(`Invalid semver`); throw new Error(`Invalid semver`);
} }
const versions = await getVersions(repo); const versions = await getVersions(repo);
const ver = semver.maxSatisfying(Object.keys(versions.tags), v); const ver = semver_1.default.maxSatisfying(Object.keys(versions.tags), v);
if (!ver) { if (!ver) {
throw new Error(`No matched releases of xmake-version ${v.format()}`); throw new Error(`No matched releases of xmake-version ${v.format()}`);
} }
const sha = versions.tags[ver]; const sha = versions.tags[ver];
return new VersionImpl(repo, ver, sha, 'tags', ver); return new GitVersionImpl(repo, ver, sha, 'tags', ver);
} }
async function selectSha(repo, sha) { async function selectSha(repo, sha) {
var _a; var _a;
@@ -96,15 +125,18 @@ async function selectSha(repo, sha) {
return selectPr(repo, Number.parseInt(pr)); return selectPr(repo, Number.parseInt(pr));
} }
} }
return Promise.resolve(new VersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`)); return Promise.resolve(new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`));
} }
async function selectVersion(version) { async function selectVersion(version) {
// get version string
version = (version !== null && version !== void 0 ? version : core.getInput('xmake-version')) || 'latest'; version = (version !== null && version !== void 0 ? version : core.getInput('xmake-version')) || 'latest';
if (version.toLowerCase() === 'latest') if (version.toLowerCase() === 'latest')
version = ''; version = '';
let repo = DEFAULT_REPO; let repo = DEFAULT_REPO;
let ret; let ret;
if (version.startsWith('local#')) {
const path = version.slice('local#'.length);
ret = new LocalVersionImpl(path);
}
{ {
const match = /^([^/#]+\/[^/#]+)#(.+)$/.exec(version); const match = /^([^/#]+\/[^/#]+)#(.+)$/.exec(version);
if (match) { if (match) {
@@ -112,12 +144,10 @@ async function selectVersion(version) {
version = match[2]; version = match[2];
} }
} }
// select branch
if (version.startsWith('branch@')) { if (version.startsWith('branch@')) {
const branch = version.substr('branch@'.length); const branch = version.substr('branch@'.length);
ret = await selectBranch(repo, branch); ret = await selectBranch(repo, branch);
} }
// select pr
if (version.startsWith('pr@')) { if (version.startsWith('pr@')) {
const pr = Number.parseInt(version.substr('pr@'.length)); const pr = Number.parseInt(version.substr('pr@'.length));
if (Number.isNaN(pr) || pr <= 0) { if (Number.isNaN(pr) || pr <= 0) {
@@ -125,20 +155,23 @@ async function selectVersion(version) {
} }
ret = await selectPr(repo, pr); ret = await selectPr(repo, pr);
} }
// select sha
if (version.startsWith('sha@')) { if (version.startsWith('sha@')) {
const sha = version.substr('sha@'.length); const sha = version.substr('sha@'.length);
ret = await selectSha(repo, sha); ret = await selectSha(repo, sha);
} }
// select version if (semver_1.default.validRange(version)) {
if (semver.validRange(version)) {
ret = await selectSemver(repo, version); ret = await selectSemver(repo, version);
} }
if (!ret) { if (!ret) {
throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`); throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`);
} }
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` + if (ret.type === 'local') {
(repo !== DEFAULT_REPO ? ` of ${repo}` : '')); core.info(`Use local xmake at '${ret.path}'`);
}
else {
core.info(`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` +
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''));
}
return ret; return ret;
} }
exports.selectVersion = selectVersion; exports.selectVersion = selectVersion;
+28 -10
View File
@@ -1,18 +1,36 @@
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.winInstall = void 0; exports.winInstall = void 0;
const core = require("@actions/core"); const core = __importStar(require("@actions/core"));
const exec_1 = require("@actions/exec"); const exec_1 = require("@actions/exec");
const io = require("@actions/io"); const io = __importStar(require("@actions/io"));
const toolCache = require("@actions/tool-cache"); const toolCache = __importStar(require("@actions/tool-cache"));
const os = require("os"); const os = __importStar(require("os"));
const path = require("path"); const path = __importStar(require("path"));
const semver = require("semver"); const semver = __importStar(require("semver"));
function getInstallerUrl(version) { function getInstallerUrl(version) {
const ver = version.version; const ver = version.version;
switch (version.type) { switch (version.type) {
case 'heads': { case 'heads': {
// we only use appveyor ci artifacts for branch version
const arch = os.arch() === 'x64' ? 'x64' : 'x86'; const arch = os.arch() === 'x64' ? 'x64' : 'x86';
return `https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=${ver}&pr=false&job=Image%3A+Visual+Studio+2017%3B+Platform%3A+${arch}`; return `https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=${ver}&pr=false&job=Image%3A+Visual+Studio+2017%3B+Platform%3A+${arch}`;
} }
@@ -23,21 +41,21 @@ function getInstallerUrl(version) {
throw new Error('Sha builds for windows is not supported'); throw new Error('Sha builds for windows is not supported');
} }
case 'tags': { case 'tags': {
// we cannot use appveyor ci artifacts, the old version links may be broken.
const arch = os.arch() === 'x64' ? 'win64' : 'win32'; const arch = os.arch() === 'x64' ? 'win64' : 'win32';
return semver.gt(ver, '2.2.6') return semver.gt(ver, '2.2.6')
? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe` ? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe`
: `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.exe`; : `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.exe`;
} }
default: { default: {
// check that we have tested all types
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _ = version.type; const _ = version.type;
throw new Error('Unknown version type'); throw new Error('Unknown version type');
} }
} }
} }
async function winInstall(version) { async function winInstall(version) {
if (version.type === 'local') {
throw new Error('Local builds for windows is not supported');
}
const ver = version.version; const ver = version.version;
let toolDir = toolCache.find('xmake', ver); let toolDir = toolCache.find('xmake', ver);
if (!toolDir) { if (!toolDir) {
+12 -12
View File
@@ -11,7 +11,7 @@
"@actions/core@^1.2.4", "@actions/core@^1.2.4",
"@actions/exec@^1.0.4", "@actions/exec@^1.0.4",
"@actions/io@^1.0.1", "@actions/io@^1.0.1",
"@actions/tool-cache@^1.5.5", "@actions/tool-cache@^1.6.0",
"@types/jest@^26.0.3", "@types/jest@^26.0.3",
"@types/node@^14.0.14", "@types/node@^14.0.14",
"@types/semver@^7.3.1", "@types/semver@^7.3.1",
@@ -35,7 +35,7 @@
"@actions/exec@^1.0.4": "https://registry.npm.taobao.org/@actions/exec/download/@actions/exec-1.0.4.tgz#99d75310e62e59fc37d2ee6dcff6d4bffadd3a5d", "@actions/exec@^1.0.4": "https://registry.npm.taobao.org/@actions/exec/download/@actions/exec-1.0.4.tgz#99d75310e62e59fc37d2ee6dcff6d4bffadd3a5d",
"@actions/http-client@^1.0.8": "https://registry.npm.taobao.org/@actions/http-client/download/@actions/http-client-1.0.8.tgz#8bd76e8eca89dc8bcf619aa128eba85f7a39af45", "@actions/http-client@^1.0.8": "https://registry.npm.taobao.org/@actions/http-client/download/@actions/http-client-1.0.8.tgz#8bd76e8eca89dc8bcf619aa128eba85f7a39af45",
"@actions/io@^1.0.1": "https://registry.npm.taobao.org/@actions/io/download/@actions/io-1.0.2.tgz#2f614b6e69ce14d191180451eb38e6576a6e6b27", "@actions/io@^1.0.1": "https://registry.npm.taobao.org/@actions/io/download/@actions/io-1.0.2.tgz#2f614b6e69ce14d191180451eb38e6576a6e6b27",
"@actions/tool-cache@^1.5.5": "https://registry.npm.taobao.org/@actions/tool-cache/download/@actions/tool-cache-1.5.5.tgz#2a49253f0f5838b9c4929b6f7cc7d73ae3ef4d2d", "@actions/tool-cache@^1.6.0": "https://registry.npm.taobao.org/@actions/tool-cache/download/@actions/tool-cache-1.6.0.tgz#5b425db2d642df65dd0d6bcec0d84dcdbca3f80d",
"@babel/code-frame@^7.0.0": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.4.tgz?cache=0&sync_timestamp=1593522826253&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a", "@babel/code-frame@^7.0.0": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.4.tgz?cache=0&sync_timestamp=1593522826253&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a",
"@babel/code-frame@^7.10.4": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.4.tgz?cache=0&sync_timestamp=1593522826253&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a", "@babel/code-frame@^7.10.4": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.4.tgz?cache=0&sync_timestamp=1593522826253&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a",
"@babel/core@^7.1.0": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.10.4.tgz?cache=0&sync_timestamp=1593522846862&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcore%2Fdownload%2F%40babel%2Fcore-7.10.4.tgz#780e8b83e496152f8dd7df63892b2e052bf1d51d", "@babel/core@^7.1.0": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.10.4.tgz?cache=0&sync_timestamp=1593522846862&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcore%2Fdownload%2F%40babel%2Fcore-7.10.4.tgz#780e8b83e496152f8dd7df63892b2e052bf1d51d",
@@ -113,19 +113,19 @@
"@types/jest@^26.0.3": "https://registry.npm.taobao.org/@types/jest/download/@types/jest-26.0.4.tgz#d2e513e85aca16992816f192582b5e67b0b15efb", "@types/jest@^26.0.3": "https://registry.npm.taobao.org/@types/jest/download/@types/jest-26.0.4.tgz#d2e513e85aca16992816f192582b5e67b0b15efb",
"@types/json-schema@^7.0.3": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.5.tgz?cache=0&sync_timestamp=1591720921048&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd", "@types/json-schema@^7.0.3": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.5.tgz?cache=0&sync_timestamp=1591720921048&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd",
"@types/node@*": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.18.tgz?cache=0&sync_timestamp=1594067570282&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.18.tgz#5111b2285659442f9f95697386a2b42b875bd7e9", "@types/node@*": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.18.tgz?cache=0&sync_timestamp=1594067570282&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.18.tgz#5111b2285659442f9f95697386a2b42b875bd7e9",
"@types/node@^14.0.14": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.18.tgz?cache=0&sync_timestamp=1594067570282&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.18.tgz#5111b2285659442f9f95697386a2b42b875bd7e9", "@types/node@^14.0.14": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.23.tgz?cache=0&sync_timestamp=1594655900445&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806",
"@types/normalize-package-data@^2.4.0": "https://registry.npm.taobao.org/@types/normalize-package-data/download/@types/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e", "@types/normalize-package-data@^2.4.0": "https://registry.npm.taobao.org/@types/normalize-package-data/download/@types/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e",
"@types/prettier@^2.0.0": "https://registry.npm.taobao.org/@types/prettier/download/@types/prettier-2.0.2.tgz?cache=0&sync_timestamp=1594074131001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fprettier%2Fdownload%2F%40types%2Fprettier-2.0.2.tgz#5bb52ee68d0f8efa9cc0099920e56be6cc4e37f3", "@types/prettier@^2.0.0": "https://registry.npm.taobao.org/@types/prettier/download/@types/prettier-2.0.2.tgz?cache=0&sync_timestamp=1594074131001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fprettier%2Fdownload%2F%40types%2Fprettier-2.0.2.tgz#5bb52ee68d0f8efa9cc0099920e56be6cc4e37f3",
"@types/semver@^7.3.1": "https://registry.npm.taobao.org/@types/semver/download/@types/semver-7.3.1.tgz#7a9a5d595b6d873f338c867dcef64df289468cfa", "@types/semver@^7.3.1": "https://registry.npm.taobao.org/@types/semver/download/@types/semver-7.3.1.tgz#7a9a5d595b6d873f338c867dcef64df289468cfa",
"@types/stack-utils@^1.0.1": "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e", "@types/stack-utils@^1.0.1": "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e",
"@types/yargs-parser@*": "https://registry.npm.taobao.org/@types/yargs-parser/download/@types/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d", "@types/yargs-parser@*": "https://registry.npm.taobao.org/@types/yargs-parser/download/@types/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d",
"@types/yargs@^15.0.0": "https://registry.npm.taobao.org/@types/yargs/download/@types/yargs-15.0.5.tgz?cache=0&sync_timestamp=1589406630222&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fyargs%2Fdownload%2F%40types%2Fyargs-15.0.5.tgz#947e9a6561483bdee9adffc983e91a6902af8b79", "@types/yargs@^15.0.0": "https://registry.npm.taobao.org/@types/yargs/download/@types/yargs-15.0.5.tgz?cache=0&sync_timestamp=1589406630222&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fyargs%2Fdownload%2F%40types%2Fyargs-15.0.5.tgz#947e9a6561483bdee9adffc983e91a6902af8b79",
"@typescript-eslint/eslint-plugin@^3.4.0": "https://registry.npm.taobao.org/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-3.6.0.tgz#ba2b6cae478b8fca3f2e58ff1313e4198eea2d8a", "@typescript-eslint/eslint-plugin@^3.4.0": "https://registry.npm.taobao.org/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-3.6.1.tgz?cache=0&sync_timestamp=1594935114117&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Feslint-plugin%2Fdownload%2F%40typescript-eslint%2Feslint-plugin-3.6.1.tgz#5ced8fd2087fbb83a76973dea4a0d39d9cb4a642",
"@typescript-eslint/experimental-utils@3.6.0": "https://registry.npm.taobao.org/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-3.6.0.tgz#0138152d66e3e53a6340f606793fb257bf2d76a1", "@typescript-eslint/experimental-utils@3.6.1": "https://registry.npm.taobao.org/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-3.6.1.tgz?cache=0&sync_timestamp=1594933408823&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fexperimental-utils%2Fdownload%2F%40typescript-eslint%2Fexperimental-utils-3.6.1.tgz#b5a2738ebbceb3fa90c5b07d50bb1225403c4a54",
"@typescript-eslint/parser@^3.4.0": "https://registry.npm.taobao.org/@typescript-eslint/parser/download/@typescript-eslint/parser-3.6.0.tgz#79b5232e1a2d06f1fc745942b690cd87aca7b60e", "@typescript-eslint/parser@^3.4.0": "https://registry.npm.taobao.org/@typescript-eslint/parser/download/@typescript-eslint/parser-3.6.1.tgz?cache=0&sync_timestamp=1594935111878&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fparser%2Fdownload%2F%40typescript-eslint%2Fparser-3.6.1.tgz#216e8adf4ee9c629f77c985476a2ea07fb80e1dc",
"@typescript-eslint/types@3.6.0": "https://registry.npm.taobao.org/@typescript-eslint/types/download/@typescript-eslint/types-3.6.0.tgz#4bd6eee55d2f9d35a4b36c4804be1880bf68f7bc", "@typescript-eslint/types@3.6.1": "https://registry.npm.taobao.org/@typescript-eslint/types/download/@typescript-eslint/types-3.6.1.tgz?cache=0&sync_timestamp=1594935117300&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Ftypes%2Fdownload%2F%40typescript-eslint%2Ftypes-3.6.1.tgz#87600fe79a1874235d3cc1cf5c7e1a12eea69eee",
"@typescript-eslint/typescript-estree@3.6.0": "https://registry.npm.taobao.org/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-3.6.0.tgz#9b4cab43f1192b64ff51530815b8919f166ce177", "@typescript-eslint/typescript-estree@3.6.1": "https://registry.npm.taobao.org/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-3.6.1.tgz?cache=0&sync_timestamp=1594933407856&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Ftypescript-estree%2Fdownload%2F%40typescript-eslint%2Ftypescript-estree-3.6.1.tgz#a5c91fcc5497cce7922ff86bc37d5e5891dcdefa",
"@typescript-eslint/visitor-keys@3.6.0": "https://registry.npm.taobao.org/@typescript-eslint/visitor-keys/download/@typescript-eslint/visitor-keys-3.6.0.tgz#44185eb0cc47651034faa95c5e2e8b314ecebb26", "@typescript-eslint/visitor-keys@3.6.1": "https://registry.npm.taobao.org/@typescript-eslint/visitor-keys/download/@typescript-eslint/visitor-keys-3.6.1.tgz?cache=0&sync_timestamp=1594935117477&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fvisitor-keys%2Fdownload%2F%40typescript-eslint%2Fvisitor-keys-3.6.1.tgz#5c57a7772f4dd623cfeacc219303e7d46f963b37",
"abab@^2.0.3": "https://registry.npm.taobao.org/abab/download/abab-2.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fabab%2Fdownload%2Fabab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a", "abab@^2.0.3": "https://registry.npm.taobao.org/abab/download/abab-2.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fabab%2Fdownload%2Fabab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a",
"acorn-globals@^6.0.0": "https://registry.npm.taobao.org/acorn-globals/download/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45", "acorn-globals@^6.0.0": "https://registry.npm.taobao.org/acorn-globals/download/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45",
"acorn-jsx@^5.2.0": "https://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe", "acorn-jsx@^5.2.0": "https://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe",
@@ -404,6 +404,7 @@
"jest-runtime@^26.1.0": "https://registry.npm.taobao.org/jest-runtime/download/jest-runtime-26.1.0.tgz#45a37af42115f123ed5c51f126c05502da2469cb", "jest-runtime@^26.1.0": "https://registry.npm.taobao.org/jest-runtime/download/jest-runtime-26.1.0.tgz#45a37af42115f123ed5c51f126c05502da2469cb",
"jest-serializer@^26.1.0": "https://registry.npm.taobao.org/jest-serializer/download/jest-serializer-26.1.0.tgz?cache=0&sync_timestamp=1592924069336&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-serializer%2Fdownload%2Fjest-serializer-26.1.0.tgz#72a394531fc9b08e173dc7d297440ac610d95022", "jest-serializer@^26.1.0": "https://registry.npm.taobao.org/jest-serializer/download/jest-serializer-26.1.0.tgz?cache=0&sync_timestamp=1592924069336&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-serializer%2Fdownload%2Fjest-serializer-26.1.0.tgz#72a394531fc9b08e173dc7d297440ac610d95022",
"jest-snapshot@^26.1.0": "https://registry.npm.taobao.org/jest-snapshot/download/jest-snapshot-26.1.0.tgz?cache=0&sync_timestamp=1592924084940&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-snapshot%2Fdownload%2Fjest-snapshot-26.1.0.tgz#c36ed1e0334bd7bd2fe5ad07e93a364ead7e1349", "jest-snapshot@^26.1.0": "https://registry.npm.taobao.org/jest-snapshot/download/jest-snapshot-26.1.0.tgz?cache=0&sync_timestamp=1592924084940&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-snapshot%2Fdownload%2Fjest-snapshot-26.1.0.tgz#c36ed1e0334bd7bd2fe5ad07e93a364ead7e1349",
"jest-util@26.x": "https://registry.npm.taobao.org/jest-util/download/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8",
"jest-util@^26.1.0": "https://registry.npm.taobao.org/jest-util/download/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8", "jest-util@^26.1.0": "https://registry.npm.taobao.org/jest-util/download/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8",
"jest-validate@^26.1.0": "https://registry.npm.taobao.org/jest-validate/download/jest-validate-26.1.0.tgz#942c85ad3d60f78250c488a7f85d8f11a29788e7", "jest-validate@^26.1.0": "https://registry.npm.taobao.org/jest-validate/download/jest-validate-26.1.0.tgz#942c85ad3d60f78250c488a7f85d8f11a29788e7",
"jest-watcher@^26.1.0": "https://registry.npm.taobao.org/jest-watcher/download/jest-watcher-26.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-watcher%2Fdownload%2Fjest-watcher-26.1.0.tgz#99812a0cd931f0cb3d153180426135ab83e4d8f2", "jest-watcher@^26.1.0": "https://registry.npm.taobao.org/jest-watcher/download/jest-watcher-26.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-watcher%2Fdownload%2Fjest-watcher-26.1.0.tgz#99812a0cd931f0cb3d153180426135ab83e4d8f2",
@@ -446,7 +447,6 @@
"map-cache@^0.2.2": "https://registry.npm.taobao.org/map-cache/download/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf", "map-cache@^0.2.2": "https://registry.npm.taobao.org/map-cache/download/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf",
"map-visit@^1.0.0": "https://registry.npm.taobao.org/map-visit/download/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f", "map-visit@^1.0.0": "https://registry.npm.taobao.org/map-visit/download/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f",
"merge-stream@^2.0.0": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60", "merge-stream@^2.0.0": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60",
"micromatch@4.x": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259",
"micromatch@^3.1.4": "https://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23", "micromatch@^3.1.4": "https://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23",
"micromatch@^4.0.2": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259", "micromatch@^4.0.2": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259",
"mime-db@1.44.0": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92", "mime-db@1.44.0": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92",
@@ -634,7 +634,7 @@
"tough-cookie@^3.0.1": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-3.0.1.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2", "tough-cookie@^3.0.1": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-3.0.1.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2",
"tough-cookie@~2.5.0": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2", "tough-cookie@~2.5.0": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2",
"tr46@^2.0.2": "https://registry.npm.taobao.org/tr46/download/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479", "tr46@^2.0.2": "https://registry.npm.taobao.org/tr46/download/tr46-2.0.2.tgz#03273586def1595ae08fedb38d7733cee91d2479",
"ts-jest@^26.1.1": "https://registry.npm.taobao.org/ts-jest/download/ts-jest-26.1.1.tgz?cache=0&sync_timestamp=1592809194862&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-jest%2Fdownload%2Fts-jest-26.1.1.tgz#b98569b8a4d4025d966b3d40c81986dd1c510f8d", "ts-jest@^26.1.1": "https://registry.npm.taobao.org/ts-jest/download/ts-jest-26.1.2.tgz?cache=0&sync_timestamp=1594635415527&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-jest%2Fdownload%2Fts-jest-26.1.2.tgz#dd2e832ffae9cb803361483b6a3010a6413dc475",
"tslib@^1.8.1": "https://registry.npm.taobao.org/tslib/download/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043", "tslib@^1.8.1": "https://registry.npm.taobao.org/tslib/download/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043",
"tsutils@^3.17.1": "https://registry.npm.taobao.org/tsutils/download/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759", "tsutils@^3.17.1": "https://registry.npm.taobao.org/tsutils/download/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759",
"tunnel-agent@^0.6.0": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd", "tunnel-agent@^0.6.0": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd",
@@ -650,7 +650,7 @@
"type-fest@^0.6.0": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.6.0.tgz?cache=0&sync_timestamp=1593290904787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b", "type-fest@^0.6.0": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.6.0.tgz?cache=0&sync_timestamp=1593290904787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b",
"type-fest@^0.8.1": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz?cache=0&sync_timestamp=1593290904787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d", "type-fest@^0.8.1": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz?cache=0&sync_timestamp=1593290904787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftype-fest%2Fdownload%2Ftype-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d",
"typedarray-to-buffer@^3.1.5": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz?cache=0&sync_timestamp=1580310064722&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypedarray-to-buffer%2Fdownload%2Ftypedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080", "typedarray-to-buffer@^3.1.5": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz?cache=0&sync_timestamp=1580310064722&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypedarray-to-buffer%2Fdownload%2Ftypedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080",
"typescript@^3.9.5": "https://registry.npm.taobao.org/typescript/download/typescript-3.9.6.tgz?cache=0&sync_timestamp=1594104611497&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a", "typescript@^3.9.5": "https://registry.npm.taobao.org/typescript/download/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa",
"union-value@^1.0.0": "https://registry.npm.taobao.org/union-value/download/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847", "union-value@^1.0.0": "https://registry.npm.taobao.org/union-value/download/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847",
"unset-value@^1.0.0": "https://registry.npm.taobao.org/unset-value/download/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559", "unset-value@^1.0.0": "https://registry.npm.taobao.org/unset-value/download/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559",
"uri-js@^4.2.2": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0", "uri-js@^4.2.2": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0",
+4
View File
@@ -29,6 +29,10 @@ if (process.platform === 'win32') {
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z'); const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to'); const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to');
} }
else if (process.platform === 'darwin') {
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0.pkg');
const node12ExtractedFolder = await tc.extractXar(node12Path, 'path/to/extract/to');
}
else { else {
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz'); const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-linux-x64.tar.gz');
const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to'); const node12ExtractedFolder = await tc.extractTar(node12Path, 'path/to/extract/to');
+9
View File
@@ -37,6 +37,15 @@ export declare function extract7z(file: string, dest?: string, _7zPath?: string)
* @returns path to the destination directory * @returns path to the destination directory
*/ */
export declare function extractTar(file: string, dest?: string, flags?: string | string[]): Promise<string>; export declare function extractTar(file: string, dest?: string, flags?: string | string[]): Promise<string>;
/**
* Extract a xar compatible archive
*
* @param file path to the archive
* @param dest destination directory. Optional.
* @param flags flags for the xar. Optional.
* @returns path to the destination directory
*/
export declare function extractXar(file: string, dest?: string, flags?: string | string[]): Promise<string>;
/** /**
* Extract a zip * Extract a zip
* *
+38
View File
@@ -42,6 +42,7 @@ class HTTPError extends Error {
} }
exports.HTTPError = HTTPError; exports.HTTPError = HTTPError;
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
const IS_MAC = process.platform === 'darwin';
const userAgent = 'actions/tool-cache'; const userAgent = 'actions/tool-cache';
/** /**
* Download a tool from an url and stream it into a file * Download a tool from an url and stream it into a file
@@ -257,6 +258,36 @@ function extractTar(file, dest, flags = 'xz') {
}); });
} }
exports.extractTar = extractTar; exports.extractTar = extractTar;
/**
* Extract a xar compatible archive
*
* @param file path to the archive
* @param dest destination directory. Optional.
* @param flags flags for the xar. Optional.
* @returns path to the destination directory
*/
function extractXar(file, dest, flags = []) {
return __awaiter(this, void 0, void 0, function* () {
assert_1.ok(IS_MAC, 'extractXar() not supported on current OS');
assert_1.ok(file, 'parameter "file" is required');
dest = yield _createExtractFolder(dest);
let args;
if (flags instanceof Array) {
args = flags;
}
else {
args = [flags];
}
args.push('-x', '-C', dest, '-f', file);
if (core.isDebug()) {
args.push('-v');
}
const xarPath = yield io.which('xar', true);
yield exec_1.exec(`"${xarPath}"`, _unique(args));
return dest;
});
}
exports.extractXar = extractXar;
/** /**
* Extract a zip * Extract a zip
* *
@@ -565,4 +596,11 @@ function _getGlobal(key, defaultValue) {
/* eslint-enable @typescript-eslint/no-explicit-any */ /* eslint-enable @typescript-eslint/no-explicit-any */
return value !== undefined ? value : defaultValue; return value !== undefined ? value : defaultValue;
} }
/**
* Returns an array of unique values.
* @param values Values to make unique.
*/
function _unique(values) {
return Array.from(new Set(values));
}
//# sourceMappingURL=tool-cache.js.map //# sourceMappingURL=tool-cache.js.map
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@actions/tool-cache", "name": "@actions/tool-cache",
"version": "1.5.5", "version": "1.6.0",
"description": "Actions tool-cache lib", "description": "Actions tool-cache lib",
"keywords": [ "keywords": [
"github", "github",
@@ -28,7 +28,7 @@
"directory": "packages/tool-cache" "directory": "packages/tool-cache"
}, },
"scripts": { "scripts": {
"audit-moderate": "npm install && npm audit --audit-level=moderate", "audit-moderate": "npm install && npm audit --json --audit-level=moderate > audit.json",
"test": "echo \"Error: run tests from root\" && exit 1", "test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc" "tsc": "tsc"
}, },
+42 -41
View File
@@ -1,43 +1,44 @@
{ {
"name": "github-action-setup-xmake", "name": "github-action-setup-xmake",
"version": "1.0.3", "version": "1.0.3",
"description": "Set up your GitHub Actions workflow with a specific version of xmake", "description": "Set up your GitHub Actions workflow with a specific version of xmake",
"main": "dist/index.js", "main": "dist/index.js",
"author": "OpportunityLiu", "author": "OpportunityLiu",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"repository": "https://github.com/xmake-io/github-action-setup-xmake.git", "repository": "https://github.com/xmake-io/github-action-setup-xmake.git",
"homepage": "https://github.com/xmake-io/github-action-setup-xmake", "homepage": "https://github.com/xmake-io/github-action-setup-xmake",
"scripts": { "scripts": {
"init": "yarn install && yarn clean", "init": "yarn install && yarn clean",
"watch": "tsc --watch", "watch": "tsc --watch",
"build": "tsc --build ./tsconfig.build.json", "build": "tsc --build ./tsconfig.build.json",
"rebuild": "yarn clean && yarn build", "rebuild": "yarn clean && yarn build",
"clean": "rimraf dist", "clean": "rimraf dist",
"lint": "eslint --fix src/**/*.ts", "lint": "eslint --fix src/**/*.ts",
"test": "jest", "format": "prettier --write .",
"release": "yarn rebuild && yarn lint && yarn install --production --no-bin-links" "test": "jest",
}, "release": "yarn format && yarn lint && yarn rebuild && yarn test && yarn install --production --no-bin-links"
"dependencies": { },
"@actions/core": "^1.2.4", "dependencies": {
"@actions/exec": "^1.0.4", "@actions/core": "^1.2.4",
"@actions/io": "^1.0.1", "@actions/exec": "^1.0.4",
"@actions/tool-cache": "^1.5.5", "@actions/io": "^1.0.1",
"semver": "^7.3.2" "@actions/tool-cache": "^1.6.0",
}, "semver": "^7.3.2"
"devDependencies": { },
"@types/jest": "^26.0.3", "devDependencies": {
"@types/node": "^14.0.14", "@types/jest": "^26.0.3",
"@types/semver": "^7.3.1", "@types/node": "^14.0.14",
"@typescript-eslint/eslint-plugin": "^3.4.0", "@types/semver": "^7.3.1",
"@typescript-eslint/parser": "^3.4.0", "@typescript-eslint/eslint-plugin": "^3.4.0",
"eslint": "^7.3.1", "@typescript-eslint/parser": "^3.4.0",
"eslint-config-prettier": "^6.11.0", "eslint": "^7.3.1",
"eslint-plugin-prettier": "^3.1.4", "eslint-config-prettier": "^6.11.0",
"jest": "^26.1.0", "eslint-plugin-prettier": "^3.1.4",
"prettier": "^2.0.5", "jest": "^26.1.0",
"rimraf": "^3.0.2", "prettier": "^2.0.5",
"ts-jest": "^26.1.1", "rimraf": "^3.0.2",
"type-fest": "^0.16.0", "ts-jest": "^26.1.1",
"typescript": "^3.9.5" "type-fest": "^0.16.0",
} "typescript": "^3.9.5"
}
} }
+9 -1
View File
@@ -33,9 +33,17 @@ export type RefDic = {
>; >;
}; };
export interface Version { export interface GitVersion {
version: string; version: string;
sha: Sha; sha: Sha;
type: keyof RefDic | 'sha'; type: keyof RefDic | 'sha';
repo: Repo; repo: Repo;
} }
export interface LocalVersion {
type: 'local';
path: string;
version: undefined;
}
export type Version = GitVersion | LocalVersion;
+35 -21
View File
@@ -1,32 +1,46 @@
import * as core from '@actions/core'; import core from '@actions/core';
import { exec } from '@actions/exec'; import { exec } from '@actions/exec';
import * as io from '@actions/io'; import io from '@actions/io';
import * as toolCache from '@actions/tool-cache'; import toolCache from '@actions/tool-cache';
import * as os from 'os'; import os from 'os';
import * as path from 'path'; import path from 'path';
import * as semver from 'semver'; import semver from 'semver';
import * as git from './git'; import * as git from './git';
import { Version } from './interfaces'; import { Version } from './interfaces';
async function install(sourceDir: string, binDir: string): Promise<void> {
await exec('make', ['build'], { cwd: sourceDir });
await exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir });
}
export async function unixInstall(version: Version): Promise<void> { export async function unixInstall(version: Version): Promise<void> {
const ver = version.version; let toolDir: string;
let toolDir = toolCache.find('xmake', ver); if (version.type !== 'local') {
if (!toolDir) { const ver = version.version;
const sourceDir = await core.group(`download xmake ${String(version)}`, () => toolDir = toolCache.find('xmake', ver);
git.create(version.repo, version.sha), if (!toolDir) {
); const sourceDir = await core.group(`download xmake ${String(version)}`, () =>
toolDir = await core.group(`install xmake ${String(version)}`, async () => { git.create(version.repo, version.sha),
await exec('make', ['build'], { cwd: sourceDir }); );
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`); toolDir = await core.group(`install xmake ${String(version)}`, async () => {
await exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir }); const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver); await install(sourceDir, binDir);
await io.rmRF(binDir); const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
await git.cleanup(version.sha); await io.rmRF(binDir);
return cacheDir; await git.cleanup(version.sha);
return cacheDir;
});
}
} else {
// no tool cache for local install
toolDir = await core.group(`install local xmake at '${version.path}'`, async () => {
const binDir = path.join(os.tmpdir(), `xmake-${Date.now()}`);
await install(version.path, binDir);
return binDir;
}); });
} }
// for versions 2.3.2 and above, xmake will be installed directly into the bin directory, and no script will be used to wrap it. // for versions 2.3.2 and above, xmake will be installed directly into the bin directory, and no script will be used to wrap it.
if (version.type !== 'tags' || semver.gt(ver, '2.3.1')) { if (version.type !== 'tags' || semver.gt(version.version, '2.3.1')) {
core.addPath(path.join(toolDir, 'bin')); core.addPath(path.join(toolDir, 'bin'));
} else { } else {
core.addPath(path.join(toolDir, 'share', 'xmake')); // only for <= 2.3.1 core.addPath(path.join(toolDir, 'share', 'xmake')); // only for <= 2.3.1
+22
View File
@@ -271,6 +271,7 @@ jest.mock('./git', () => ({
})); }));
import { selectVersion } from './versions'; import { selectVersion } from './versions';
import { Repo } from './interfaces'; import { Repo } from './interfaces';
import { resolve } from 'path';
describe('selectVersion', () => { describe('selectVersion', () => {
it('should return correct version for latest', async () => { it('should return correct version for latest', async () => {
@@ -411,4 +412,25 @@ describe('selectVersion', () => {
type: 'heads', type: 'heads',
}); });
}); });
it('should return local cwd', async () => {
await expect(selectVersion('local#')).resolves.toEqual({
path: process.cwd(),
type: 'local',
});
});
it('should return absolute path', async () => {
await expect(selectVersion('local#/usr/bin')).resolves.toEqual({
path: resolve('/usr/bin'),
type: 'local',
});
});
it('should return relative path', async () => {
await expect(selectVersion('local#xmake')).resolves.toEqual({
path: resolve('xmake'),
type: 'local',
});
});
}); });
+33 -14
View File
@@ -1,7 +1,8 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as semver from 'semver'; import semver from 'semver';
import { lsRemote } from './git'; import { lsRemote } from './git';
import { RefDic, Sha, Version, Repo } from './interfaces'; import { RefDic, Sha, Version, Repo, GitVersion, LocalVersion } from './interfaces';
import p from 'path';
const DEFAULT_REPO = Repo('xmake-io/xmake'); const DEFAULT_REPO = Repo('xmake-io/xmake');
@@ -14,12 +15,12 @@ async function getVersions(repo: Repo): Promise<RefDic> {
return result; return result;
} }
class VersionImpl implements Version { class GitVersionImpl implements GitVersion {
constructor( constructor(
readonly repo: Repo, readonly repo: Repo,
readonly version: string, readonly version: string,
readonly sha: Sha, readonly sha: Sha,
readonly type: Version['type'], readonly type: GitVersion['type'],
toString: string, toString: string,
) { ) {
this.#string = toString; this.#string = toString;
@@ -30,10 +31,18 @@ class VersionImpl implements Version {
} }
} }
class LocalVersionImpl implements LocalVersion {
readonly type = 'local';
readonly version: undefined;
constructor(readonly path: string) {
this.path = p.resolve(path);
}
}
async function selectBranch(repo: Repo, branch: string): Promise<Version> { async function selectBranch(repo: Repo, branch: string): Promise<Version> {
const versions = await getVersions(repo); const versions = await getVersions(repo);
if (branch in versions.heads) { if (branch in versions.heads) {
return new VersionImpl(repo, branch, versions.heads[branch], 'heads', `branch ${branch}`); return new GitVersionImpl(repo, branch, versions.heads[branch], 'heads', `branch ${branch}`);
} }
throw new Error(`Branch ${branch} not found`); throw new Error(`Branch ${branch} not found`);
} }
@@ -41,10 +50,10 @@ async function selectBranch(repo: Repo, branch: string): Promise<Version> {
async function selectPr(repo: Repo, pr: number): Promise<Version> { async function selectPr(repo: Repo, pr: number): Promise<Version> {
const versions = await getVersions(repo); const versions = await getVersions(repo);
if (pr in versions.pull) { if (pr in versions.pull) {
const prheads = versions.pull[pr]; const prHeads = versions.pull[pr];
const sha = prheads.merge ?? prheads.head; const sha = prHeads.merge ?? prHeads.head;
if (sha) { if (sha) {
return new VersionImpl(repo, `pr#${pr}`, sha, 'pull', `pull request #${pr}`); return new GitVersionImpl(repo, `pr#${pr}`, sha, 'pull', `pull request #${pr}`);
} }
} }
throw new Error(`Pull requrest #${pr} not found`); throw new Error(`Pull requrest #${pr} not found`);
@@ -64,7 +73,7 @@ async function selectSemver(repo: Repo, version: string): Promise<Version> {
} }
const sha = versions.tags[ver]; const sha = versions.tags[ver];
return new VersionImpl(repo, ver, sha, 'tags', ver); return new GitVersionImpl(repo, ver, sha, 'tags', ver);
} }
async function selectSha(repo: Repo, sha: string): Promise<Version> { async function selectSha(repo: Repo, sha: string): Promise<Version> {
@@ -87,7 +96,7 @@ async function selectSha(repo: Repo, sha: string): Promise<Version> {
} }
} }
return Promise.resolve( return Promise.resolve(
new VersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`), new GitVersionImpl(repo, `sha#${shaValue}`, shaValue, 'sha', `commit ${shaValue.substr(0, 8)}`),
); );
} }
@@ -98,6 +107,12 @@ export async function selectVersion(version?: string): Promise<Version> {
let repo = DEFAULT_REPO; let repo = DEFAULT_REPO;
let ret: Version | undefined; let ret: Version | undefined;
// select local
if (version.startsWith('local#')) {
const path = version.slice('local#'.length);
ret = new LocalVersionImpl(path);
}
{ {
const match = /^([^/#]+\/[^/#]+)#(.+)$/.exec(version); const match = /^([^/#]+\/[^/#]+)#(.+)$/.exec(version);
if (match) { if (match) {
@@ -131,9 +146,13 @@ export async function selectVersion(version?: string): Promise<Version> {
if (!ret) { if (!ret) {
throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`); throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`);
} }
core.info( if (ret.type === 'local') {
`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` + core.info(`Use local xmake at '${ret.path}'`);
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''), } else {
); core.info(
`Selected xmake ${String(ret)} (commit: ${ret.sha.substr(0, 8)})` +
(repo !== DEFAULT_REPO ? ` of ${repo}` : ''),
);
}
return ret; return ret;
} }
+5 -3
View File
@@ -5,9 +5,9 @@ import * as toolCache from '@actions/tool-cache';
import * as os from 'os'; import * as os from 'os';
import * as path from 'path'; import * as path from 'path';
import * as semver from 'semver'; 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; const ver = version.version;
switch (version.type) { switch (version.type) {
case 'heads': { case 'heads': {
@@ -30,7 +30,6 @@ function getInstallerUrl(version: Version): string {
} }
default: { default: {
// check that we have tested all types // check that we have tested all types
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _: never = version.type; const _: never = version.type;
throw new Error('Unknown 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> { 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; const ver = version.version;
let toolDir = toolCache.find('xmake', ver); let toolDir = toolCache.find('xmake', ver);
if (!toolDir) { if (!toolDir) {
+5 -2
View File
@@ -1,4 +1,7 @@
{ {
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"exclude": ["**/*.spec.ts"] "compilerOptions": {
"removeComments": true
},
"exclude": ["**/*.spec.ts"]
} }
+11 -10
View File
@@ -1,12 +1,13 @@
{ {
"include": ["src/**/*"], "include": ["src/**/*"],
"compileOnSave": true, "compileOnSave": true,
"compilerOptions": { "compilerOptions": {
"strict": true, "strict": true,
"moduleResolution": "node", "moduleResolution": "node",
"module": "commonjs", "module": "commonjs",
"target": "es2018", "target": "es2018",
"outDir": "dist", "outDir": "dist",
"types": ["node", "jest"] "types": ["node", "jest"],
} "esModuleInterop": true
}
} }
+56 -51
View File
@@ -26,10 +26,10 @@
resolved "https://registry.npm.taobao.org/@actions/io/download/@actions/io-1.0.2.tgz#2f614b6e69ce14d191180451eb38e6576a6e6b27" resolved "https://registry.npm.taobao.org/@actions/io/download/@actions/io-1.0.2.tgz#2f614b6e69ce14d191180451eb38e6576a6e6b27"
integrity sha1-L2FLbmnOFNGRGARR6zjmV2puayc= integrity sha1-L2FLbmnOFNGRGARR6zjmV2puayc=
"@actions/tool-cache@^1.5.5": "@actions/tool-cache@^1.6.0":
version "1.5.5" version "1.6.0"
resolved "https://registry.npm.taobao.org/@actions/tool-cache/download/@actions/tool-cache-1.5.5.tgz#2a49253f0f5838b9c4929b6f7cc7d73ae3ef4d2d" resolved "https://registry.npm.taobao.org/@actions/tool-cache/download/@actions/tool-cache-1.6.0.tgz#5b425db2d642df65dd0d6bcec0d84dcdbca3f80d"
integrity sha1-KkklPw9YOLnEkptvfMfXOuPvTS0= integrity sha1-W0JdstZC32XdDWvOwNhNzbyj+A0=
dependencies: dependencies:
"@actions/core" "^1.2.3" "@actions/core" "^1.2.3"
"@actions/exec" "^1.0.0" "@actions/exec" "^1.0.0"
@@ -605,11 +605,16 @@
resolved "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.5.tgz?cache=0&sync_timestamp=1591720921048&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" resolved "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.5.tgz?cache=0&sync_timestamp=1591720921048&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjson-schema%2Fdownload%2F%40types%2Fjson-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd"
integrity sha1-3M5EMOZLRDuolF8CkPtWStW6xt0= integrity sha1-3M5EMOZLRDuolF8CkPtWStW6xt0=
"@types/node@*", "@types/node@^14.0.14": "@types/node@*":
version "14.0.18" version "14.0.18"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.18.tgz?cache=0&sync_timestamp=1594067570282&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.18.tgz#5111b2285659442f9f95697386a2b42b875bd7e9" resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.18.tgz?cache=0&sync_timestamp=1594067570282&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.18.tgz#5111b2285659442f9f95697386a2b42b875bd7e9"
integrity sha1-URGyKFZZRC+flWlzhqK0K4db1+k= integrity sha1-URGyKFZZRC+flWlzhqK0K4db1+k=
"@types/node@^14.0.14":
version "14.0.23"
resolved "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.23.tgz?cache=0&sync_timestamp=1594655900445&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806"
integrity sha1-Z2+giDRQ7Z2guyQVYhNjYpCJKAY=
"@types/normalize-package-data@^2.4.0": "@types/normalize-package-data@^2.4.0":
version "2.4.0" version "2.4.0"
resolved "https://registry.npm.taobao.org/@types/normalize-package-data/download/@types/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" resolved "https://registry.npm.taobao.org/@types/normalize-package-data/download/@types/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
@@ -645,51 +650,51 @@
"@types/yargs-parser" "*" "@types/yargs-parser" "*"
"@typescript-eslint/eslint-plugin@^3.4.0": "@typescript-eslint/eslint-plugin@^3.4.0":
version "3.6.0" version "3.6.1"
resolved "https://registry.npm.taobao.org/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-3.6.0.tgz#ba2b6cae478b8fca3f2e58ff1313e4198eea2d8a" resolved "https://registry.npm.taobao.org/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-3.6.1.tgz?cache=0&sync_timestamp=1594935114117&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Feslint-plugin%2Fdownload%2F%40typescript-eslint%2Feslint-plugin-3.6.1.tgz#5ced8fd2087fbb83a76973dea4a0d39d9cb4a642"
integrity sha1-uitsrkeLj8o/Llj/ExPkGY7qLYo= integrity sha1-XO2P0gh/u4OnaXPepKDTnZy0pkI=
dependencies: dependencies:
"@typescript-eslint/experimental-utils" "3.6.0" "@typescript-eslint/experimental-utils" "3.6.1"
debug "^4.1.1" debug "^4.1.1"
functional-red-black-tree "^1.0.1" functional-red-black-tree "^1.0.1"
regexpp "^3.0.0" regexpp "^3.0.0"
semver "^7.3.2" semver "^7.3.2"
tsutils "^3.17.1" tsutils "^3.17.1"
"@typescript-eslint/experimental-utils@3.6.0": "@typescript-eslint/experimental-utils@3.6.1":
version "3.6.0" version "3.6.1"
resolved "https://registry.npm.taobao.org/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-3.6.0.tgz#0138152d66e3e53a6340f606793fb257bf2d76a1" resolved "https://registry.npm.taobao.org/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-3.6.1.tgz?cache=0&sync_timestamp=1594933408823&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fexperimental-utils%2Fdownload%2F%40typescript-eslint%2Fexperimental-utils-3.6.1.tgz#b5a2738ebbceb3fa90c5b07d50bb1225403c4a54"
integrity sha1-ATgVLWbj5TpjQPYGeT+yV78tdqE= integrity sha1-taJzjrvOs/qQxbB9ULsSJUA8SlQ=
dependencies: dependencies:
"@types/json-schema" "^7.0.3" "@types/json-schema" "^7.0.3"
"@typescript-eslint/types" "3.6.0" "@typescript-eslint/types" "3.6.1"
"@typescript-eslint/typescript-estree" "3.6.0" "@typescript-eslint/typescript-estree" "3.6.1"
eslint-scope "^5.0.0" eslint-scope "^5.0.0"
eslint-utils "^2.0.0" eslint-utils "^2.0.0"
"@typescript-eslint/parser@^3.4.0": "@typescript-eslint/parser@^3.4.0":
version "3.6.0" version "3.6.1"
resolved "https://registry.npm.taobao.org/@typescript-eslint/parser/download/@typescript-eslint/parser-3.6.0.tgz#79b5232e1a2d06f1fc745942b690cd87aca7b60e" resolved "https://registry.npm.taobao.org/@typescript-eslint/parser/download/@typescript-eslint/parser-3.6.1.tgz?cache=0&sync_timestamp=1594935111878&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fparser%2Fdownload%2F%40typescript-eslint%2Fparser-3.6.1.tgz#216e8adf4ee9c629f77c985476a2ea07fb80e1dc"
integrity sha1-ebUjLhotBvH8dFlCtpDNh6yntg4= integrity sha1-IW6K307pxin3fJhUdqLqB/uA4dw=
dependencies: dependencies:
"@types/eslint-visitor-keys" "^1.0.0" "@types/eslint-visitor-keys" "^1.0.0"
"@typescript-eslint/experimental-utils" "3.6.0" "@typescript-eslint/experimental-utils" "3.6.1"
"@typescript-eslint/types" "3.6.0" "@typescript-eslint/types" "3.6.1"
"@typescript-eslint/typescript-estree" "3.6.0" "@typescript-eslint/typescript-estree" "3.6.1"
eslint-visitor-keys "^1.1.0" eslint-visitor-keys "^1.1.0"
"@typescript-eslint/types@3.6.0": "@typescript-eslint/types@3.6.1":
version "3.6.0" version "3.6.1"
resolved "https://registry.npm.taobao.org/@typescript-eslint/types/download/@typescript-eslint/types-3.6.0.tgz#4bd6eee55d2f9d35a4b36c4804be1880bf68f7bc" resolved "https://registry.npm.taobao.org/@typescript-eslint/types/download/@typescript-eslint/types-3.6.1.tgz?cache=0&sync_timestamp=1594935117300&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Ftypes%2Fdownload%2F%40typescript-eslint%2Ftypes-3.6.1.tgz#87600fe79a1874235d3cc1cf5c7e1a12eea69eee"
integrity sha1-S9bu5V0vnTWks2xIBL4YgL9o97w= integrity sha1-h2AP55oYdCNdPMHPXH4aEu6mnu4=
"@typescript-eslint/typescript-estree@3.6.0": "@typescript-eslint/typescript-estree@3.6.1":
version "3.6.0" version "3.6.1"
resolved "https://registry.npm.taobao.org/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-3.6.0.tgz#9b4cab43f1192b64ff51530815b8919f166ce177" resolved "https://registry.npm.taobao.org/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-3.6.1.tgz?cache=0&sync_timestamp=1594933407856&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Ftypescript-estree%2Fdownload%2F%40typescript-eslint%2Ftypescript-estree-3.6.1.tgz#a5c91fcc5497cce7922ff86bc37d5e5891dcdefa"
integrity sha1-m0yrQ/EZK2T/UVMIFbiRnxZs4Xc= integrity sha1-pckfzFSXzOeSL/hrw31eWJHc3vo=
dependencies: dependencies:
"@typescript-eslint/types" "3.6.0" "@typescript-eslint/types" "3.6.1"
"@typescript-eslint/visitor-keys" "3.6.0" "@typescript-eslint/visitor-keys" "3.6.1"
debug "^4.1.1" debug "^4.1.1"
glob "^7.1.6" glob "^7.1.6"
is-glob "^4.0.1" is-glob "^4.0.1"
@@ -697,10 +702,10 @@
semver "^7.3.2" semver "^7.3.2"
tsutils "^3.17.1" tsutils "^3.17.1"
"@typescript-eslint/visitor-keys@3.6.0": "@typescript-eslint/visitor-keys@3.6.1":
version "3.6.0" version "3.6.1"
resolved "https://registry.npm.taobao.org/@typescript-eslint/visitor-keys/download/@typescript-eslint/visitor-keys-3.6.0.tgz#44185eb0cc47651034faa95c5e2e8b314ecebb26" resolved "https://registry.npm.taobao.org/@typescript-eslint/visitor-keys/download/@typescript-eslint/visitor-keys-3.6.1.tgz?cache=0&sync_timestamp=1594935117477&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fvisitor-keys%2Fdownload%2F%40typescript-eslint%2Fvisitor-keys-3.6.1.tgz#5c57a7772f4dd623cfeacc219303e7d46f963b37"
integrity sha1-RBhesMxHZRA0+qlcXi6LMU7OuyY= integrity sha1-XFendy9N1iPP6swhkwPn1G+WOzc=
dependencies: dependencies:
eslint-visitor-keys "^1.1.0" eslint-visitor-keys "^1.1.0"
@@ -2509,7 +2514,7 @@ jest-snapshot@^26.1.0:
pretty-format "^26.1.0" pretty-format "^26.1.0"
semver "^7.3.2" semver "^7.3.2"
jest-util@^26.1.0: jest-util@26.x, jest-util@^26.1.0:
version "26.1.0" version "26.1.0"
resolved "https://registry.npm.taobao.org/jest-util/download/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8" resolved "https://registry.npm.taobao.org/jest-util/download/jest-util-26.1.0.tgz#80e85d4ba820decacf41a691c2042d5276e5d8d8"
integrity sha1-gOhdS6gg3srPQaaRwgQtUnbl2Ng= integrity sha1-gOhdS6gg3srPQaaRwgQtUnbl2Ng=
@@ -2771,14 +2776,6 @@ merge-stream@^2.0.0:
resolved "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" resolved "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
integrity sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A= integrity sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=
micromatch@4.x, micromatch@^4.0.2:
version "4.0.2"
resolved "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
integrity sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=
dependencies:
braces "^3.0.1"
picomatch "^2.0.5"
micromatch@^3.1.4: micromatch@^3.1.4:
version "3.1.10" version "3.1.10"
resolved "https://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" resolved "https://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
@@ -2798,6 +2795,14 @@ micromatch@^3.1.4:
snapdragon "^0.8.1" snapdragon "^0.8.1"
to-regex "^3.0.2" to-regex "^3.0.2"
micromatch@^4.0.2:
version "4.0.2"
resolved "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259"
integrity sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=
dependencies:
braces "^3.0.1"
picomatch "^2.0.5"
mime-db@1.44.0: mime-db@1.44.0:
version "1.44.0" version "1.44.0"
resolved "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" resolved "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92"
@@ -3823,17 +3828,17 @@ tr46@^2.0.2:
punycode "^2.1.1" punycode "^2.1.1"
ts-jest@^26.1.1: ts-jest@^26.1.1:
version "26.1.1" version "26.1.2"
resolved "https://registry.npm.taobao.org/ts-jest/download/ts-jest-26.1.1.tgz?cache=0&sync_timestamp=1592809194862&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-jest%2Fdownload%2Fts-jest-26.1.1.tgz#b98569b8a4d4025d966b3d40c81986dd1c510f8d" resolved "https://registry.npm.taobao.org/ts-jest/download/ts-jest-26.1.2.tgz?cache=0&sync_timestamp=1594635415527&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fts-jest%2Fdownload%2Fts-jest-26.1.2.tgz#dd2e832ffae9cb803361483b6a3010a6413dc475"
integrity sha1-uYVpuKTUAl2Waz1AyBmG3RxRD40= integrity sha1-3S6DL/rpy4AzYUg7ajAQpkE9xHU=
dependencies: dependencies:
bs-logger "0.x" bs-logger "0.x"
buffer-from "1.x" buffer-from "1.x"
fast-json-stable-stringify "2.x" fast-json-stable-stringify "2.x"
jest-util "26.x"
json5 "2.x" json5 "2.x"
lodash.memoize "4.x" lodash.memoize "4.x"
make-error "1.x" make-error "1.x"
micromatch "4.x"
mkdirp "1.x" mkdirp "1.x"
semver "7.x" semver "7.x"
yargs-parser "18.x" yargs-parser "18.x"
@@ -3914,9 +3919,9 @@ typedarray-to-buffer@^3.1.5:
is-typedarray "^1.0.0" is-typedarray "^1.0.0"
typescript@^3.9.5: typescript@^3.9.5:
version "3.9.6" version "3.9.7"
resolved "https://registry.npm.taobao.org/typescript/download/typescript-3.9.6.tgz?cache=0&sync_timestamp=1594104611497&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a" resolved "https://registry.npm.taobao.org/typescript/download/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
integrity sha1-jz4BmKNMOuFwkbNVcdOv0xmZNlo= integrity sha1-mNYApevcOPQMsndSLxLcgA6eJfo=
union-value@^1.0.0: union-value@^1.0.0:
version "1.0.1" version "1.0.1"