From: Stas'M Date: Mon, 1 Oct 2018 15:18:26 +0000 (+0300) Subject: AppVeyor: Automatize DFWAD building X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=a44f9f2c72baa86a57cd107a9c6140dea4a2b423;p=DF-Res.git AppVeyor: Automatize DFWAD building --- diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..fd7da3b --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,65 @@ +version: 1.0.{build} +environment: + UploadFtp: doom2d.org + UploadUser: + secure: nmt2wy+rrB3V3E0VaH6Wkw== + UploadPass: + secure: RSpIXLDEgnLc1s8K4/kXtg== +build_script: +- cmd: make.cmd +on_success: +- ps: >- + function uploadFtp($server, $user, $pass, $filename, $path) + + { + $srv = [System.Net.FtpWebRequest]::Create($server + $filename) + $srv = [System.Net.FtpWebRequest]$srv + $srv.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile + $srv.Credentials = new-object System.Net.NetworkCredential($user, $pass) + $srv.UseBinary = $true + $srv.UsePassive = $true + + $content = [System.IO.File]::ReadAllBytes($path) + $srv.ContentLength = $content.Length + + $rs = $srv.GetRequestStream() + $rs.Write($content, 0, $content.Length) + + try + { + $rs.Close() + $rs.Dispose() + "Success" + } + catch + { + } + } + + + if ($env:APPVEYOR_REPO_BRANCH -eq "master") + + { + Write-Host "[*] Uploading DFWAD files..." + $Dir = "." + $ftp = "ftp://" + $env:UploadFtp + "/" + $user = $env:UploadUser + $pass = $env:UploadPass + + foreach ($item in (dir $Dir "*.wad")) + { + "[*] Uploading $item..." + $check = uploadFtp $ftp $user $pass $item.Name $item.FullName + while ($check -ne "Success") + { + "[*] Retrying upload $item..." + $check = uploadFtp $ftp $user $pass $item.Name $item.FullName + } + } + } + + else + + { + Write-Host "[*] Uploading DFWAD files skipped (not master branch)." + } \ No newline at end of file diff --git a/make.cmd b/make.cmd index 20a0892..b97b12c 100644 --- a/make.cmd +++ b/make.cmd @@ -8,4 +8,3 @@ call pack_dnd Doomer.lst call pack_dnd Doom2D.lst echo [*] Build All done. echo. -pause