Skip to content

Commit

Permalink
Auto publish releases
Browse files Browse the repository at this point in the history
  • Loading branch information
hozuki committed Apr 24, 2019
1 parent 1712ccf commit 56041aa
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
14 changes: 13 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions scripts/configure-cmake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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

Expand Down
14 changes: 7 additions & 7 deletions scripts/package-artifacts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ switch ($arch) {
$buildArch = 'x86';
}
default {
echo "Unsupported arch: $arch";
Write-Output "Unsupported arch: $arch";
exit 1;
}
}
Expand All @@ -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

0 comments on commit 56041aa

Please sign in to comment.