From: Jan-Pascal van Best Date: Mon, 23 Apr 2012 07:08:35 +0000 (+0200) Subject: Added perl script to upload binary download to github X-Git-Tag: 0.9.2~5 X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=9201a851b0f19774e364bf8ea0b4b1523623fb3e;p=tv_grab_nl_java Added perl script to upload binary download to github --- diff --git a/.gitignore b/.gitignore index a1a0d4a..b5fbc8d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /cachedb.* /tv_grab_nl_java.db.properties *.orig +/github-token diff --git a/pom.xml b/pom.xml index b8ab1ff..4ae19e0 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.vanbest.xmltv.tv_grab_nl_java tv_grab_nl_java - 0.9.1 + 0.9.2-SNAPSHOT net.sf.json-lib diff --git a/tv_grab_nl_java.nsi b/tv_grab_nl_java.nsi index 1a00762..39079e1 100644 --- a/tv_grab_nl_java.nsi +++ b/tv_grab_nl_java.nsi @@ -75,6 +75,7 @@ Delete $INSTDIR\changelog.txt RMDir $INSTDIR ; now remove all the startmenu links +Delete "$SMPROGRAMS\tv_grab_nl_java\Configure tv_grab_nl_java.lnk" Delete "$SMPROGRAMS\tv_grab_nl_java\Run tv_grab_nl_java.lnk" Delete "$SMPROGRAMS\tv_grab_nl_java\Uninstall tv_grab_nl_java.lnk" RMDIR "$SMPROGRAMS\tv_grab_nl_java" diff --git a/upload.pl b/upload.pl new file mode 100755 index 0000000..fa30ef3 --- /dev/null +++ b/upload.pl @@ -0,0 +1,38 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Pithub::Repos::Downloads; + +my $version = shift(); + +open(TOKENFILE,'github-token'); +my $token; +while(){ + chomp; + $token=$_; +} + +my $download = Pithub::Repos::Downloads->new( + user => 'janpascal', + repo => 'tv_grab_nl_java', + token => $token +); + +my $result = $download->create( + data => { + name => "tv_grab_nl_java-$version.zip", + size => ( stat("../tv_grab_nl_java-$version.zip") )[7], + description => "tv_grab_nl_java release $version" , + content_type => 'application/zip', + }, +); + +if ( $result->success ) { + my $upload = $download->upload( + result => $result, + file => "../tv_grab_nl_java-$version.zip", + ); + if ( $upload->is_success ) { + printf "The file has been uploaded succesfully and is now available at: %s\n", $result->content->{html_url}; + } +}