[deploy] fix: coapp build
This commit is contained in:
parent
c438a797a5
commit
6f187cfc94
|
|
@ -1,41 +1,49 @@
|
||||||
. .\scripts\appveyor\appveyor_get_build.ps1
|
. .\scripts\appveyor\appveyor_get_build.ps1
|
||||||
. .\scripts\appveyor\appveyor_get_artifacts.ps1
|
. .\scripts\appveyor\appveyor_get_artifacts.ps1
|
||||||
|
. .\scripts\appveyor\copy_recurse.ps1
|
||||||
# get job artifacts
|
|
||||||
Write-Host "Start to download artifacts from other jobs"
|
# get job artifacts
|
||||||
|
Write-Host "Start to download artifacts from other jobs"
|
||||||
(Get-AppVeyorBuild).build.jobs | foreach-object {
|
|
||||||
$jobId = $_.jobId
|
(Get-AppVeyorBuild).build.jobs | foreach-object {
|
||||||
if ($jobId -ne $env:APPVEYOR_JOB_ID) {
|
$jobId = $_.jobId
|
||||||
# Get job artifacts information
|
if ($jobId -ne $env:APPVEYOR_JOB_ID) {
|
||||||
(Get-AppVeyorArtifacts -Job $jobId) | foreach-object {
|
# Get job artifacts information
|
||||||
# Create directory if not exists
|
(Get-AppVeyorArtifacts -Job $jobId) | foreach-object {
|
||||||
$filePath = $_.fileName.Substring(0, $_.fileName.LastIndexOf('/'))
|
# Create directory if not exists
|
||||||
if (!(Test-Path -Path $filePath)) {
|
$filePath = $_.fileName.Substring(0, $_.fileName.LastIndexOf('/'))
|
||||||
New-Item -ItemType "directory" -Path $filePath
|
if (!(Test-Path -Path $filePath)) {
|
||||||
}
|
New-Item -ItemType "directory" -Path $filePath
|
||||||
# Download artifact from other job
|
}
|
||||||
Start-FileDownload "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$($_.fileName)" -FileName $_.fileName
|
# Download artifact from other job
|
||||||
}
|
Start-FileDownload "https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/$($_.fileName)" -FileName $_.fileName
|
||||||
};
|
}
|
||||||
}
|
};
|
||||||
|
}
|
||||||
Write-Host "Start to build nupkg files"
|
|
||||||
|
Write-Host "Start to build nupkg files"
|
||||||
# This is the CoApp .autopkg file to create.
|
|
||||||
$autopkgFile = "scripts\coapp\kiwano.autopkg"
|
# This is the CoApp .autopkg file to create.
|
||||||
|
$autopkgFile = "scripts\coapp\kiwano.autopkg"
|
||||||
# Create a copy of ".autopkg" file
|
|
||||||
Copy-Item -Path $autopkgFile -Destination ($autopkgFile + '.template')
|
# Copy include files
|
||||||
|
Copy-Recurse -Path "src\" -Destination "include\" -Filter "*.h"
|
||||||
# Get the ".autopkg.template" file, replace "@appveyor_version" with the Appveyor version number, then save to the ".autopkg" file.
|
Copy-Recurse -Path "src\" -Destination "include\" -Filter "*.hpp"
|
||||||
Get-Content ($autopkgFile + ".template") -Encoding UTF8 | ForEach-Object { $_ -replace "@appveyor_version", $env:appveyor_build_version } | Out-File $autopkgFile -Encoding UTF8
|
Remove-Item -Path "include\3rd-party" -Recurse
|
||||||
|
Copy-Recurse -Path "src\3rd-party\" -Destination "include\" -Filter "*.h"
|
||||||
# Delete the copy file
|
Copy-Recurse -Path "src\3rd-party\" -Destination "include\" -Filter "*.hpp"
|
||||||
Remove-Item -Path ($autopkgFile + '.template')
|
|
||||||
|
# Create a copy of ".autopkg" file
|
||||||
# Use the CoApp tools to create NuGet native packages from the .autopkg.
|
Copy-Item -Path $autopkgFile -Destination ($autopkgFile + '.template')
|
||||||
Write-NuGetPackage $autopkgFile
|
|
||||||
|
# Get the ".autopkg.template" file, replace "@appveyor_version" with the Appveyor version number, then save to the ".autopkg" file.
|
||||||
# Push all newly created .nupkg files as Appveyor artifacts for later deployment.
|
Get-Content ($autopkgFile + ".template") -Encoding UTF8 | ForEach-Object { $_ -replace "@appveyor_version", $env:appveyor_build_version } | Out-File $autopkgFile -Encoding UTF8
|
||||||
Get-ChildItem .\*.nupkg | ForEach-Object { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
|
||||||
|
# Delete the copy file
|
||||||
|
Remove-Item -Path ($autopkgFile + '.template')
|
||||||
|
|
||||||
|
# Use the CoApp tools to create NuGet native packages from the .autopkg.
|
||||||
|
Write-NuGetPackage $autopkgFile
|
||||||
|
|
||||||
|
# Push all newly created .nupkg files as Appveyor artifacts for later deployment.
|
||||||
|
Get-ChildItem .\*.nupkg | ForEach-Object { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
function Copy-Recurse {
|
||||||
|
param(
|
||||||
|
[string]$Path,
|
||||||
|
[string]$Destination,
|
||||||
|
[string]$Filter
|
||||||
|
)
|
||||||
|
|
||||||
|
New-Item -ItemType Directory -Force -Path $Destination | Out-Null
|
||||||
|
|
||||||
|
Get-ChildItem -Recurse -Path $Path -Filter $Filter | ForEach-Object {
|
||||||
|
$relativePath = $_.FullName.Replace((Resolve-Path $Path).Path, "")
|
||||||
|
$targetFile = Join-Path -Path $Destination -ChildPath $relativePath
|
||||||
|
|
||||||
|
$targetFileDirectory = Split-Path -Path $targetFile -Parent
|
||||||
|
|
||||||
|
if (!(Test-Path $targetFileDirectory))
|
||||||
|
{
|
||||||
|
New-Item -ItemType Directory -Force -Path $targetFileDirectory | Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
Copy-Item -Path $_.FullName -Destination $targetFile -Force
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ nuget {
|
||||||
// The nuspec file metadata.
|
// The nuspec file metadata.
|
||||||
nuspec {
|
nuspec {
|
||||||
id = Kiwano;
|
id = Kiwano;
|
||||||
// "@appveyor_version" is replaced by the current Appveyor build number in the
|
// "appveyor_version" is replaced by the current Appveyor build number in the
|
||||||
// pre-deployment script.
|
// pre-deployment script.
|
||||||
version: @appveyor_version;
|
version: @appveyor_version;
|
||||||
title: Kiwano Game Framework;
|
title: Kiwano Game Framework;
|
||||||
|
|
@ -86,13 +86,14 @@ nuget {
|
||||||
|
|
||||||
files {
|
files {
|
||||||
#defines {
|
#defines {
|
||||||
|
INCLUDE_ROOT = ..\..\include;
|
||||||
SRC_ROOT = ..\..\src;
|
SRC_ROOT = ..\..\src;
|
||||||
OUTPUT_DIR = ..\..\projects\output;
|
OUTPUT_DIR = ..\..\projects\output;
|
||||||
}
|
}
|
||||||
|
|
||||||
include: {
|
include: {
|
||||||
${SRC_ROOT}\kiwano*\**\*.h, ${SRC_ROOT}\kiwano*\**\*.hpp,
|
${INCLUDE_ROOT}\**\*.h,
|
||||||
${SRC_ROOT}\3rd-party\**\*.h, ${SRC_ROOT}\3rd-party\**\*.hpp,
|
${INCLUDE_ROOT}\**\*.hpp,
|
||||||
};
|
};
|
||||||
|
|
||||||
// third patry
|
// third patry
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue