forked from Ann0ying/Themely
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis-upload.js
59 lines (51 loc) · 1.27 KB
/
.travis-upload.js
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
// Themely bleeding edge build uploader
// Copyright (c) 2017 Erman SAYIN
var GitHubApi = require("github");
var github = new GitHubApi({
protocol: "https",
host: "api.github.com",
pathPrefix: "",
headers: {
"user-agent": "Themely bleeding edge build uploader"
},
followRedirects: false,
timeout: 25000
});
// authenticate
github.authenticate({
type: "token",
token: process.env.bleedingEdgeRepoOAuthToken
});
// create release
github.repos.createRelease({
owner: "ErmanSayin",
repo: "Themely-bleeding",
tag_name: process.env.TRAVIS_COMMIT.substr(0, 7),
name: process.env.TRAVIS_COMMIT,
body: process.env.TRAVIS_COMMIT_MESSAGE
}, function(err, res){
if(err) throw err;
var releaseId = res.data.id;
// now upload the cia
github.repos.uploadAsset({
owner: "ErmanSayin",
repo: "Themely-bleeding",
id: releaseId,
filePath: "output/3ds-arm/Themely.cia",
name: "Themely.cia"
}, function(err, res){
if(err) throw err;
// neat, now upload the 3dsx
github.repos.uploadAsset({
owner: "ErmanSayin",
repo: "Themely-bleeding",
id: releaseId,
filePath: "output/3ds-arm/3ds/Themely/Themely.3dsx",
name: "Themely.3dsx"
}, function(err, res){
if(err) throw err;
// cool and good
console.log("Success uploading bleeding edge builds.");
});
});
});