@@ -7,13 +7,13 @@ import * as path from 'path';
77import * as semver from 'semver' ;
88import { Version , GitVersion } from './interfaces' ;
99
10- function getInstallerUrl ( version : GitVersion ) : string {
10+ function getInstallerUrl ( version : GitVersion , latest : GitVersion ) : string {
1111 const ver = version . version ;
1212 switch ( version . type ) {
1313 case 'heads' : {
14- // we only use appveyor ci artifacts for branch version
15- const arch = os . arch ( ) === 'x64' ? 'x64' : 'x86' ;
16- 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 } ` ;
14+ const arch = os . arch ( ) === 'x64' ? 'win64' : 'win32' ;
15+ const latestver = latest . version ;
16+ return `https://github. com/xmake-io/xmake/releases/download/ ${ latestver } /xmake-${ ver } . ${ arch } .exe ` ;
1717 }
1818 case 'pull' : {
1919 throw new Error ( 'PR builds for windows is not supported' ) ;
@@ -22,7 +22,6 @@ function getInstallerUrl(version: GitVersion): string {
2222 throw new Error ( 'Sha builds for windows is not supported' ) ;
2323 }
2424 case 'tags' : {
25- // we cannot use appveyor ci artifacts, the old version links may be broken.
2625 const arch = os . arch ( ) === 'x64' ? 'win64' : 'win32' ;
2726 return semver . gt ( ver , '2.2.6' )
2827 ? `https://github.com/xmake-io/xmake/releases/download/${ ver } /xmake-${ ver } .${ arch } .exe`
@@ -36,15 +35,15 @@ function getInstallerUrl(version: GitVersion): string {
3635 }
3736}
3837
39- export async function winInstall ( version : Version ) : Promise < void > {
40- if ( version . type === 'local' ) {
38+ export async function winInstall ( version : Version , latest : Version ) : Promise < void > {
39+ if ( version . type === 'local' || latest . type == 'local' ) {
4140 throw new Error ( 'Local builds for windows is not supported' ) ;
4241 }
4342 const ver = version . version ;
4443 let toolDir = toolCache . find ( 'xmake' , ver ) ;
4544 if ( ! toolDir ) {
4645 const installer = await core . group ( `download xmake ${ String ( version ) } ` , async ( ) => {
47- const url = getInstallerUrl ( version ) ;
46+ const url = getInstallerUrl ( version , latest ) ;
4847 core . info ( `downloading from ${ url } ` ) ;
4948 const file = await toolCache . downloadTool ( url ) ;
5049 const exe = path . format ( {
0 commit comments