diff options
| author | 2015-01-24 10:45:06 -0500 | |
|---|---|---|
| committer | 2015-01-24 12:36:49 -0500 | |
| commit | a4a1ce766d9ac0284e4bb28a1c3f7f0f3d1a6204 (patch) | |
| tree | 97e44054401215563fad0555ac07d43ce6f80942 | |
| parent | AppVeyor: Change to release build instead of debug (diff) | |
| download | yuzu-a4a1ce766d9ac0284e4bb28a1c3f7f0f3d1a6204.tar.gz yuzu-a4a1ce766d9ac0284e4bb28a1c3f7f0f3d1a6204.tar.xz yuzu-a4a1ce766d9ac0284e4bb28a1c3f7f0f3d1a6204.zip | |
AppVeyor: Sanitize the file name before uploading
| -rw-r--r-- | appveyor.yml | 11 | ||||
| -rw-r--r-- | upload_to_mega.js | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/appveyor.yml b/appveyor.yml index 8e7bacd6f..7c985b940 100644 --- a/appveyor.yml +++ b/appveyor.yml | |||
| @@ -6,9 +6,11 @@ clone_depth: 1 | |||
| 6 | 6 | ||
| 7 | environment: | 7 | environment: |
| 8 | QTDIR: C:\Qt\5.4\msvc2013_opengl | 8 | QTDIR: C:\Qt\5.4\msvc2013_opengl |
| 9 | MEGA_EMAIL: | ||
| 10 | secure: dLyH/46MKKuCZyozkwwVGCL7nVyX+Cxyo1hVlCUaQDU= | ||
| 9 | MEGA_PASSWORD: | 11 | MEGA_PASSWORD: |
| 10 | secure: ozgp54EZj98kcbD/O+Xl5Q== | 12 | secure: ozgp54EZj98kcbD/O+Xl5Q== |
| 11 | 13 | ||
| 12 | platform: | 14 | platform: |
| 13 | - Win32 | 15 | - Win32 |
| 14 | 16 | ||
| @@ -23,7 +25,7 @@ before_build: | |||
| 23 | - cd build | 25 | - cd build |
| 24 | - cmake .. | 26 | - cmake .. |
| 25 | - cd .. | 27 | - cd .. |
| 26 | 28 | ||
| 27 | after_build: | 29 | after_build: |
| 28 | # upload the build to Mega | 30 | # upload the build to Mega |
| 29 | - cinst wget -x86 | 31 | - cinst wget -x86 |
| @@ -38,12 +40,9 @@ after_build: | |||
| 38 | - copy C:\Qt\5.4\msvc2013_opengl\bin\Qt5Gui.dll build\bin\release | 40 | - copy C:\Qt\5.4\msvc2013_opengl\bin\Qt5Gui.dll build\bin\release |
| 39 | - copy C:\Qt\5.4\msvc2013_opengl\bin\Qt5OpenGL.dll build\bin\release | 41 | - copy C:\Qt\5.4\msvc2013_opengl\bin\Qt5OpenGL.dll build\bin\release |
| 40 | - copy C:\Qt\5.4\msvc2013_opengl\bin\Qt5Widgets.dll build\bin\release | 42 | - copy C:\Qt\5.4\msvc2013_opengl\bin\Qt5Widgets.dll build\bin\release |
| 41 | # delete build craps | ||
| 42 | - del /F /S /Q /A "build\bin\release\*.ilk" | ||
| 43 | - del /F /S /Q /A "build\bin\release\*.pdb" | ||
| 44 | # zip up the build folder -> build.7z | 43 | # zip up the build folder -> build.7z |
| 45 | - 7z a build .\build\bin\release\* | 44 | - 7z a build .\build\bin\release\* |
| 46 | # rename, upload to Mega | 45 | # rename, upload to Mega |
| 46 | - npm install sanitize-filename | ||
| 47 | - cd megatools-1.9.94-win64 | 47 | - cd megatools-1.9.94-win64 |
| 48 | - node ..\upload_to_mega.js | 48 | - node ..\upload_to_mega.js |
| 49 | |||
diff --git a/upload_to_mega.js b/upload_to_mega.js index 1d47f4fd8..c0abd5ed5 100644 --- a/upload_to_mega.js +++ b/upload_to_mega.js | |||
| @@ -1,11 +1,13 @@ | |||
| 1 | var util = require('util'); | 1 | var util = require('util'); |
| 2 | var exec = require('child_process').exec; | 2 | var exec = require('child_process').exec; |
| 3 | var sanitize = require("sanitize-filename"); | ||
| 3 | 4 | ||
| 4 | var email = 'chin.bimbo@gmail.com'; | 5 | var email = process.env.MEGA_EMAIL; |
| 5 | var password = process.env.MEGA_PASSWORD; | 6 | var password = process.env.MEGA_PASSWORD; |
| 6 | var sourceFileName = 'build.7z'; | 7 | var sourceFileName = 'build.7z'; |
| 7 | var dstFileName = process.env.APPVEYOR_REPO_COMMIT.substring(0, 8) + " - " + | 8 | var dstFileName = process.env.APPVEYOR_REPO_COMMIT.substring(0, 8) + " - " + |
| 8 | process.env.APPVEYOR_REPO_COMMIT_MESSAGE.substring(0, 100) + ".7z"; | 9 | process.env.APPVEYOR_REPO_COMMIT_MESSAGE.substring(0, 100) + ".7z"; |
| 10 | dstFileName = sanitize(dstFileName); | ||
| 9 | 11 | ||
| 10 | var cmd = util.format('megaput ../%s --path \"/Root/Citra/Windows/%s\" --username=%s --password=%s --no-progress', | 12 | var cmd = util.format('megaput ../%s --path \"/Root/Citra/Windows/%s\" --username=%s --password=%s --no-progress', |
| 11 | sourceFileName, | 13 | sourceFileName, |
| @@ -13,6 +15,7 @@ var cmd = util.format('megaput ../%s --path \"/Root/Citra/Windows/%s\" --usernam | |||
| 13 | email, | 15 | email, |
| 14 | password); | 16 | password); |
| 15 | 17 | ||
| 18 | // only upload build on master branch, and not on other branches or PRs | ||
| 16 | if (process.env.APPVEYOR_REPO_BRANCH == "master") { | 19 | if (process.env.APPVEYOR_REPO_BRANCH == "master") { |
| 17 | console.log("Uploading file " + dstFileName + " to Mega..."); | 20 | console.log("Uploading file " + dstFileName + " to Mega..."); |
| 18 | exec(cmd, function(error, stdout, stderr) { | 21 | exec(cmd, function(error, stdout, stderr) { |