From 469bdad9828655c324e55daa2b800cfc03bee1a0 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Fri, 30 Jul 2021 23:35:55 +0800 Subject: [PATCH] [CI] Create package.ps1 Update appveyor.yml --- appveyor.yml | 42 +----------------------------------------- package.ps1 | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 41 deletions(-) create mode 100644 package.ps1 diff --git a/appveyor.yml b/appveyor.yml index 31b19db..a904fd7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,46 +7,6 @@ build: project: source-code/PD-Loader.sln verbosity: minimal after_build: -- cmd: >- - md %TMP%\full\ - - md %TMP%\full\patches\ - - md %TMP%\full\plugins\ - - md "%TMP%\full\plugins\Novidia Shaders" - - md %TMP%\full\ram\ - - md %TMP%\full\ram\databank_template\ - - - - copy %APPVEYOR_BUILD_FOLDER%\source-code\x64\%CONFIGURATION%\dnsapi.dll %TMP%\full\ - - copy %APPVEYOR_BUILD_FOLDER%\source-code\x64\%CONFIGURATION%\*.dva %TMP%\full\plugins\ - - xcopy /E %APPVEYOR_BUILD_FOLDER%\source-code\x64\%CONFIGURATION%\zh-Hans\ %TMP%\full\plugins\zh-Hans\ - - copy "%APPVEYOR_BUILD_FOLDER%\source-code\data\README - PD Loader.url" %TMP%\full\ - - copy %APPVEYOR_BUILD_FOLDER%\source-code\data\verify_base_game.sfv %TMP%\full\ - - copy %APPVEYOR_BUILD_FOLDER%\source-code\data\verify_mount_data.sfv %TMP%\full\ - - copy %APPVEYOR_BUILD_FOLDER%\source-code\data\plugins\*.* %TMP%\full\plugins\ - - copy "%APPVEYOR_BUILD_FOLDER%\source-code\data\plugins\Novidia Shaders\*.*" "%TMP%\full\plugins\Novidia Shaders\" - - copy %APPVEYOR_BUILD_FOLDER%\source-code\data\ram\databank_template\*.dat %TMP%\full\ram\databank_template\ - - copy %APPVEYOR_BUILD_FOLDER%\source-code\data\patches\custom_freeplay_text_example.p %TMP%\full\patches\ - - - - cd %TMP%\full\ - - 7z a %APPVEYOR_BUILD_FOLDER%\PD-Loader-%CONFIGURATION%-AppVeyor.zip * - +- ps: .\package.ps1 -Clean:$false artifacts: - path: PD-Loader-*.zip diff --git a/package.ps1 b/package.ps1 new file mode 100644 index 0000000..d463ee5 --- /dev/null +++ b/package.ps1 @@ -0,0 +1,35 @@ +param ( + [Parameter()] + [ValidateSet('Debug', 'Release')] + [string] + $Configuration = 'Release', + [Parameter()] + [Switch] + $Clean = $true +) + +# Set-PSDebug -Trace 1 +Push-Location $PWD + +$RepoDir = $PSScriptRoot +$SolutionDir = "$RepoDir\source-code" +$OutputDir = "$SolutionDir\x64\$Configuration" +$PackageDir = "$env:TMP\full" +$PackageName = "$RepoDir\PD-Loader-$Configuration-AppVeyor.zip" + +if ($Clean) { + rm $PackageDir -Recurse + rm $PackageName +} + +md $PackageDir -Force +copy $SolutionDir\data\* $PackageDir\ -Recurse +copy $RepoDir\dnsapi.dll $PackageDir\ + +copy $OutputDir\*.dva $PackageDir\plugins\ +copy $OutputDir\zh-Hans $PackageDir\plugins\ -Recurse + +cd $PackageDir +7z a $PackageName * + +Pop-Location \ No newline at end of file