diff --git a/appveyor.yml b/appveyor.yml index 6c7ae1af..19d3a8a6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,21 +16,10 @@ platform: - x64 install: - cmd: >- - npm install --global npm@latest - - git clone "https://github.com/vnma0/hestia.git" -b master --single-branch "..\hestia" - - cd ..\hestia - - npm install - - npm run build - - xcopy .\build ..\wafter\public\ /s /e - - cd ..\wafter - npm install +before_build: +- ps: >- + .\hestia.ps1 > $null build_script: - cmd: >- npm run pkg diff --git a/hestia.ps1 b/hestia.ps1 new file mode 100644 index 00000000..a0827fb1 --- /dev/null +++ b/hestia.ps1 @@ -0,0 +1,21 @@ +$repo = "vnma0/hestia" + +$releases_url = "https://api.github.com/repos/$repo/releases/latest" + +Write-Host Determining latest release of Hestia... +$get_res = Invoke-WebRequest $releases_url | ConvertFrom-Json +Write-Host Hestia: $get_res.tag_name + +Write-Host Downloading latest release... +$asset_name = $get_res.assets[0].name +$asset_url = $get_res.assets[0].browser_download_url +Invoke-WebRequest $asset_url -Out $asset_name + +Write-Host Extracting latest release... +if (Test-Path -Path .\public) { + Remove-Item -path .\public -Recurse -Force +} +Expand-Archive $asset_name -DestinationPath .\public +Move-Item -Path .\public\build\* -Destination .\public +Remove-Item .\public\build +Remove-Item $asset_name