download dev from github releases
fix ci remove unused import fix releases
This commit is contained in:
committed by
Opportunity
Unverified
parent
2f05f7c4ad
commit
b126f6b6d1
@@ -8,7 +8,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
version: [latest, branch@master]
|
||||
version: [latest, branch@master, branch@dev]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
@@ -19,6 +19,7 @@ jobs:
|
||||
xmake-version: ${{ matrix.version }}
|
||||
- name: Run tests
|
||||
run: |
|
||||
xmake --version
|
||||
xmake create -P test
|
||||
xmake build -P test
|
||||
xmake run -P test
|
||||
|
||||
Vendored
+6
-3
@@ -9,10 +9,13 @@ const unix_install_1 = require("./unix-install");
|
||||
async function run() {
|
||||
try {
|
||||
const version = await versions_1.selectVersion();
|
||||
if (os.platform() === 'win32' || os.platform() === 'cygwin')
|
||||
await win_install_1.winInstall(version);
|
||||
else
|
||||
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
|
||||
const latest = await versions_1.selectVersion('latest');
|
||||
await win_install_1.winInstall(version, latest);
|
||||
}
|
||||
else {
|
||||
await unix_install_1.unixInstall(version);
|
||||
}
|
||||
await exec_1.exec('xmake --version');
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
Vendored
+7
-6
@@ -8,12 +8,13 @@ const toolCache = require("@actions/tool-cache");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
const semver = require("semver");
|
||||
function getInstallerUrl(version) {
|
||||
function getInstallerUrl(version, latest) {
|
||||
const ver = version.version;
|
||||
switch (version.type) {
|
||||
case 'heads': {
|
||||
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}`;
|
||||
const arch = os.arch() === 'x64' ? 'win64' : 'win32';
|
||||
const latestver = latest.version;
|
||||
return `https://github.com/xmake-io/xmake/releases/download/${latestver}/xmake-${ver}.${arch}.exe`;
|
||||
}
|
||||
case 'pull': {
|
||||
throw new Error('PR builds for windows is not supported');
|
||||
@@ -33,15 +34,15 @@ function getInstallerUrl(version) {
|
||||
}
|
||||
}
|
||||
}
|
||||
async function winInstall(version) {
|
||||
if (version.type === 'local') {
|
||||
async function winInstall(version, latest) {
|
||||
if (version.type === 'local' || latest.type == 'local') {
|
||||
throw new Error('Local builds for windows is not supported');
|
||||
}
|
||||
const ver = version.version;
|
||||
let toolDir = toolCache.find('xmake', ver);
|
||||
if (!toolDir) {
|
||||
const installer = await core.group(`download xmake ${String(version)}`, async () => {
|
||||
const url = getInstallerUrl(version);
|
||||
const url = getInstallerUrl(version, latest);
|
||||
core.info(`downloading from ${url}`);
|
||||
const file = await toolCache.downloadTool(url);
|
||||
const exe = path.format({
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"systemParams": "win32-x64-83",
|
||||
"systemParams": "darwin-x64-83",
|
||||
"modulesFolders": [
|
||||
"node_modules"
|
||||
],
|
||||
@@ -718,7 +718,7 @@
|
||||
"wrap-ansi@^6.2.0": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz?cache=0&sync_timestamp=1618558913931&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwrap-ansi%2Fdownload%2Fwrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53",
|
||||
"wrappy@1": "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz?cache=0&sync_timestamp=1619133505879&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrappy%2Fdownload%2Fwrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
|
||||
"write-file-atomic@^3.0.0": "https://registry.npm.taobao.org/write-file-atomic/download/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8",
|
||||
"ws@^7.4.4": "https://registry.npm.taobao.org/ws/download/ws-7.4.5.tgz#a484dd851e9beb6fdb420027e3885e8ce48986c1",
|
||||
"ws@^7.4.4": "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c",
|
||||
"xml-name-validator@^3.0.0": "https://registry.npm.taobao.org/xml-name-validator/download/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a",
|
||||
"xmlchars@^2.2.0": "https://registry.npm.taobao.org/xmlchars/download/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb",
|
||||
"y18n@^4.0.0": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.3.tgz?cache=0&sync_timestamp=1617822642544&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fy18n%2Fdownload%2Fy18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf",
|
||||
|
||||
+6
-2
@@ -8,8 +8,12 @@ import { unixInstall } from './unix-install';
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
const version = await selectVersion();
|
||||
if (os.platform() === 'win32' || os.platform() === 'cygwin') await winInstall(version);
|
||||
else await unixInstall(version);
|
||||
if (os.platform() === 'win32' || os.platform() === 'cygwin') {
|
||||
const latest = await selectVersion('latest');
|
||||
await winInstall(version, latest);
|
||||
} else {
|
||||
await unixInstall(version);
|
||||
}
|
||||
await exec('xmake --version');
|
||||
} catch (error) {
|
||||
const ex = error as Error;
|
||||
|
||||
+7
-8
@@ -7,13 +7,13 @@ import * as path from 'path';
|
||||
import * as semver from 'semver';
|
||||
import { Version, GitVersion } from './interfaces';
|
||||
|
||||
function getInstallerUrl(version: GitVersion): string {
|
||||
function getInstallerUrl(version: GitVersion, latest: GitVersion): string {
|
||||
const ver = version.version;
|
||||
switch (version.type) {
|
||||
case 'heads': {
|
||||
// we only use appveyor ci artifacts for branch version
|
||||
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}`;
|
||||
const arch = os.arch() === 'x64' ? 'win64' : 'win32';
|
||||
const latestver = latest.version;
|
||||
return `https://github.com/xmake-io/xmake/releases/download/${latestver}/xmake-${ver}.${arch}.exe`;
|
||||
}
|
||||
case 'pull': {
|
||||
throw new Error('PR builds for windows is not supported');
|
||||
@@ -22,7 +22,6 @@ function getInstallerUrl(version: GitVersion): string {
|
||||
throw new Error('Sha builds for windows is not supported');
|
||||
}
|
||||
case 'tags': {
|
||||
// we cannot use appveyor ci artifacts, the old version links may be broken.
|
||||
const arch = os.arch() === 'x64' ? 'win64' : 'win32';
|
||||
return semver.gt(ver, '2.2.6')
|
||||
? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe`
|
||||
@@ -36,15 +35,15 @@ function getInstallerUrl(version: GitVersion): string {
|
||||
}
|
||||
}
|
||||
|
||||
export async function winInstall(version: Version): Promise<void> {
|
||||
if (version.type === 'local') {
|
||||
export async function winInstall(version: Version, latest: Version): Promise<void> {
|
||||
if (version.type === 'local' || latest.type == 'local') {
|
||||
throw new Error('Local builds for windows is not supported');
|
||||
}
|
||||
const ver = version.version;
|
||||
let toolDir = toolCache.find('xmake', ver);
|
||||
if (!toolDir) {
|
||||
const installer = await core.group(`download xmake ${String(version)}`, async () => {
|
||||
const url = getInstallerUrl(version);
|
||||
const url = getInstallerUrl(version, latest);
|
||||
core.info(`downloading from ${url}`);
|
||||
const file = await toolCache.downloadTool(url);
|
||||
const exe = path.format({
|
||||
|
||||
Reference in New Issue
Block a user