Change GitHub upload to use JS GitHub lib
Needed for Appveyor when running releases
This commit is contained in:
		
					parent
					
						
							
								ec587032b2
							
						
					
				
			
			
				commit
				
					
						cb7f8e256e
					
				
			
		
					 3 changed files with 37 additions and 13 deletions
				
			
		
							
								
								
									
										21
									
								
								script/upload-to-github.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								script/upload-to-github.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,21 @@
 | 
			
		|||
const GitHub = require('github')
 | 
			
		||||
const github = new GitHub()
 | 
			
		||||
github.authenticate({type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN})
 | 
			
		||||
 | 
			
		||||
let filePath = process.argv[2]
 | 
			
		||||
let fileName = process.argv[3]
 | 
			
		||||
let releaseId = process.argv[4]
 | 
			
		||||
 | 
			
		||||
let githubOpts = {
 | 
			
		||||
  owner: 'electron',
 | 
			
		||||
  repo: 'electron',
 | 
			
		||||
  id: releaseId,
 | 
			
		||||
  filePath: filePath,
 | 
			
		||||
  name: fileName
 | 
			
		||||
}
 | 
			
		||||
github.repos.uploadAsset(githubOpts).then(() => {
 | 
			
		||||
  process.exit()
 | 
			
		||||
}).catch((err) => {
 | 
			
		||||
  console.log(`Error uploading ${fileName} to GitHub:`, err)
 | 
			
		||||
  process.exitCode = 1
 | 
			
		||||
})
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue