diff --git a/README.md b/README.md index 458b3bc..54935d5 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,10 @@ the DLL located at `tools\hcaenc_lite.dll`. - [GitHub Releases](https://github.com/hozuki/libcgss/releases) - AppVeyor (nightly) - - [VC++ 2015 x64](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-x64-vc19-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202015%3B%20Environment%3A%20arch%3DWin64) - - [VC++ 2015 x86](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-x86-vc19-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202015%3B%20Environment%3A%20arch%3DWin32) - - [VC++ 2017 x64](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-x64-vc19.1-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202017%3B%20Environment%3A%20arch%3DWin64) - - [VC++ 2017 x86](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-x86-vc19.1-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202017%3B%20Environment%3A%20arch%3DWin32) + - [VC++ 2015 x64](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-ci-x64-vc19-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202015%3B%20Environment%3A%20arch%3DWin64) + - [VC++ 2015 x86](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-ci-x86-vc19-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202015%3B%20Environment%3A%20arch%3DWin32) + - [VC++ 2017 x64](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-ci-x64-vc19.1-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202017%3B%20Environment%3A%20arch%3DWin64) + - [VC++ 2017 x86](https://ci.appveyor.com/api/projects/hozuki/libcgss/artifacts/libcgss-ci-x86-vc19.1-latest.zip?all=true&job=Image%3A%20Visual%20Studio%202017%3B%20Environment%3A%20arch%3DWin32) ## Example diff --git a/appveyor.yml b/appveyor.yml index 60625cf..815c2ae 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -21,5 +21,17 @@ after_build: - ps: .\scripts\package-artifacts.ps1 test: off artifacts: - - path: 'libcgss-*.zip' + - path: 'libcgss-bin-*.zip' name: 'Binaries' + - path: 'libcgss-ci-*.zip' + name: 'CI auto update' +deploy: + - provider: GitHub + description: 'libcgss' + auth_token: + secure: u+MFjjY665AT4PHJ2bFMINBLnnnwSj1jLnNeFZoWfeYbomTNSPOmdahffmZa+dRH + artifact: 'Binaries' # upload all NuGet packages to release assets + draft: false + prerelease: false + on: + appveyor_repo_tag: true # deploy on tag push only diff --git a/scripts/configure-cmake.ps1 b/scripts/configure-cmake.ps1 index 0a1c52f..eb8884d 100644 --- a/scripts/configure-cmake.ps1 +++ b/scripts/configure-cmake.ps1 @@ -2,16 +2,16 @@ if ($Env:ARCH -eq "Win64") { $arch = "Win64"; - echo "Arch: $arch"; + Write-Output "Arch: $arch"; # prepare for generator concatenation $arch = " $arch"; } else { - echo 'Arch: (default -> Win32)'; + Write-Output 'Arch: (default -> Win32)'; } [String]$workerImage = $Env:APPVEYOR_BUILD_WORKER_IMAGE; -echo "Build image: $workerImage"; +Write-Output "Build image: $workerImage"; [String]$generator = [String]::Empty; @@ -20,18 +20,18 @@ if ($workerImage -eq 'Visual Studio 2017') { } elseif ($workerImage -eq 'Visual Studio 2015') { $generator = "Visual Studio 14 2015$arch"; } else { - echo 'Error: Unsupported worker image.'; + Write-Output 'Error: Unsupported worker image.'; $generator = "Visual Studio 15 2017$arch"; exit 1; } -echo '------******------'; +Write-Output '------******------'; if (![System.IO.Directory]::Exists('build\vc')) { mkdir build\vc } -cd build\vc +Set-Location build\vc cmake --version diff --git a/scripts/package-artifacts.ps1 b/scripts/package-artifacts.ps1 index 1b736ab..e29130b 100644 --- a/scripts/package-artifacts.ps1 +++ b/scripts/package-artifacts.ps1 @@ -12,7 +12,7 @@ switch ($arch) { $buildArch = 'x86'; } default { - echo "Unsupported arch: $arch"; + Write-Output "Unsupported arch: $arch"; exit 1; } } @@ -25,26 +25,26 @@ switch ($workerImage) { $vsVersion = 'vc19'; } default { - echo "Unsupported worker: $workerImage"; + Write-Output "Unsupported worker: $workerImage"; exit 1; } } $configuration = $Env:CONFIGURATION; -function Run-Cmd([String]$Command) { +function Invoke-CommandLine([String]$Command) { [ScriptBlock]$script = [ScriptBlock]::Create($Command); Invoke-Command -ScriptBlock $script } $7zcmd = "7z a libcgss.zip -r bin\$buildArch\$configuration\*.exe"; -Run-Cmd -Command $7zcmd +Invoke-CommandLine -Command $7zcmd $7zcmd = "7z a libcgss.zip -r bin\$buildArch\$configuration\*.dll"; -Run-Cmd -Command $7zcmd +Invoke-CommandLine -Command $7zcmd [String]$buildVersion = $Env:APPVEYOR_BUILD_VERSION; -[String]$dest = "libcgss-$buildArch-$vsVersion-$buildVersion.zip"; +[String]$dest = "libcgss-bin-$buildArch-$vsVersion-$buildVersion.zip"; Copy-Item -Path 'libcgss.zip' -Destination $dest -$dest = "libcgss-$buildArch-$vsVersion-latest.zip"; +$dest = "libcgss-ci-$buildArch-$vsVersion-latest.zip"; Copy-Item -Path 'libcgss.zip' -Destination $dest