-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
70 lines (60 loc) · 1.81 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: 1.0.{build}
environment:
UploadFtp: doom2d.org
UploadUser:
secure: nmt2wy+rrB3V3E0VaH6Wkw==
UploadPass:
secure: RSpIXLDEgnLc1s8K4/kXtg==
UpdateKey:
secure: qabkF43L5XDdfCgJloTznxAUFP+dxwOIO/xlj3ApOk8=
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
}
}
Write-Host "[*] Updating..."
$postParams = @{key=$env:UpdateKey}
(Invoke-WebRequest -UseBasicParsing -Uri http://doom2d.org/doom2d_forever/latest/update_wads.php -Method POST -Body $postParams).Content
}
else
{
Write-Host "[*] Uploading DFWAD files skipped (not master branch)."
}