DEADSOFTWARE

AppVeyor: Automatize DFWAD building
authorStas'M <x86corez@gmail.com>
Mon, 1 Oct 2018 15:18:26 +0000 (18:18 +0300)
committerStas'M <x86corez@gmail.com>
Mon, 1 Oct 2018 19:51:34 +0000 (22:51 +0300)
appveyor.yml [new file with mode: 0644]
make.cmd

diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644 (file)
index 0000000..fd7da3b
--- /dev/null
@@ -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
index 20a0892c1c0e137405115db7953c0afef51e54ca..b97b12c0bd6e57eef4eaff025ef8745f2c41e222 100644 (file)
--- 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