This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
save builds to artifacts on appveyor
- Loading branch information
Dustin Blackman
committed
Sep 25, 2015
1 parent
73a4c0e
commit 1c9231d
Showing
5 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ coverage/ | |
*.asar | ||
*.log | ||
|
||
download.txt | ||
exit.code | ||
test.coffee | ||
test.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
cheerio = require 'cheerio' | ||
fs = require 'fs-extra' | ||
glob = require 'glob' | ||
gulp = require 'gulp' | ||
request = require 'request' | ||
runSequence = require 'run-sequence' | ||
path = require 'path' | ||
|
||
gulp.task 'build-artifact:osx', -> | ||
runSequence( | ||
'package-asar' | ||
'compile:osx' | ||
'zip:osx' | ||
'upload-artifcat' | ||
) | ||
|
||
gulp.task 'build-artifact:win', -> | ||
runSequence( | ||
'package-asar' | ||
'compile:win' | ||
'zip:win' | ||
'upload-artifcat' | ||
) | ||
|
||
gulp.task 'build-artifact', (cb) -> | ||
if process.platform == 'win32' | ||
return runSequence('build-artifact:win', cb) | ||
else | ||
return runSequence('build-artifact:osx', cb) | ||
|
||
gulp.task 'upload-artifcat', (cb) -> | ||
commit = process.env.APPVEYOR_REPO_COMMIT or process.env.TRAVIS_COMMIT or 'NO_COMMIT' | ||
file = glob.sync('./releases/*.zip')[0] | ||
file_name = "Championify-#{process.platform}-#{commit}.zip" | ||
|
||
upload_file = path.join('./releases', file_name) | ||
fs.move file, upload_file, -> | ||
options = { | ||
method: 'POST' | ||
url: 'http://www92.zippyshare.com/upload' | ||
headers: { | ||
Referer: 'http://www.zippyshare.com/sites/index_old.jsp' | ||
} | ||
} | ||
|
||
console.log('Uploading file...') | ||
req = request options, (err, res, body) -> | ||
$c = cheerio.load(body) | ||
download_url = $c('.text_field').val() | ||
fs.writeFile './download.txt', download_url, {encoding: 'utf8'}, cb | ||
|
||
form = req.form() | ||
form.append('file', fs.createReadStream(upload_file)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters