Skip to content

Commit

Permalink
Upload amxmodx-latest-<package>-<os> text file when packaging. (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkshine committed Sep 14, 2018
1 parent 7e23047 commit ac64ef0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions support/buildbot/package.pl
Expand Up @@ -5,6 +5,7 @@
use Cwd;
use File::Basename;
use File::stat;
use File::Temp qw/ tempfile :seekable/;
use Net::FTP;
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
use Time::localtime;
Expand Down Expand Up @@ -126,17 +127,30 @@
$ftp->binary();
for ($i = 0; $i <= $#packages; $i++) {
my ($filename);
my ($latest);
if ($^O eq "linux") {
$filename = "amxmodx-$version-" . $packages[$i] . "-linux.tar.gz";
$latest = "amxmodx-latest-" . $packages[$i] . "-linux";
} elsif ($^O eq "darwin") {
next if ($packages[$i] ~~ @mac_exclude);
$filename = "amxmodx-$version-" . $packages[$i] . "-mac.zip";
$latest = "amxmodx-latest-" . $packages[$i] . "-mac";
} else {
$filename = "amxmodx-$version-" . $packages[$i] . "-windows.zip";
$latest = "amxmodx-latest-" . $packages[$i] . "-windows";
}

my ($tmpfh, $tmpfile) = tempfile();
print $tmpfh $filename;
$tmpfh->seek( 0, SEEK_END );

print "Uploading $filename...\n";
$ftp->put($filename)
or die "Cannot drop file $filename ($ftp_path): " . $ftp->message . "\n";

print "Uploading $latest...\n";
$ftp->put($tmpfile, $latest)
or die "Cannot drop file $latest ($ftp_path): " . $ftp->message . "\n";
}

$ftp->close();
Expand Down

0 comments on commit ac64ef0

Please sign in to comment.