Created
July 11, 2014 06:32
-
-
Save DaveHudson/d75c13a611ecc729c0c1 to your computer and use it in GitHub Desktop.
Grunt.js + Installr API
This file contains hidden or 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
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
installr_settings: { | |
releaseNotes: grunt.file.read("./CHANGELOG.txt") | |
}, | |
titanium: { | |
build_ios: { // build for ios first | |
options: { | |
command: 'build', | |
projectDir: './', // set project dir to root of grunt.js file | |
platform: 'ios', | |
buildOnly: true, // ensure buildOnly otherwise iOS simulator starts | |
target: 'dist-adhoc', // ensure building for adhoc profile | |
distributionName: 'YOUR DIST NAME (ID)', // add your iOS dist cert details | |
ppUuid: 'YOUR PROVISIONING PROFILE', // add your iOS Provisioning Profile | |
outputDir: './dist' // optionally set a output dir (we use this to find file when uploading to installr) | |
} | |
}, | |
build_android: { // then build for Android | |
options: { | |
command: 'build', | |
projectDir: './', // set project dir to root of grunt.js file | |
platform: 'android', | |
buildOnly: true // ensure buildOnly otherwise Android emulator starts | |
} | |
} | |
}, | |
shell: { | |
installr_ios: { // upload iOS App to installr | |
options: { | |
stdout: true | |
}, | |
command: [ | |
"curl -H 'X-InstallrAppToken: YOUR_INSTARLLR_API_TOKEN' https://www.installrapp.com/apps.json " + // Insert your Installr API Token | |
"-F 'qqfile=@./dist/YOURAPPNAME.ipa' " + // Insert your IPA file name | |
"-F 'releaseNotes=<%= installr_settings.releaseNotes %>' " + // release notes pulled from installr_settings above | |
"-F 'notify=true'" | |
].join("&&") | |
}, | |
installr_android: { // upload Android App to installr | |
options: { | |
stdout: true | |
}, | |
command: [ | |
"curl -H 'X-InstallrAppToken: YOUR_INSTALLR_API_TOKEN' https://www.installrapp.com/apps.json " + // Insert your Installr API Token | |
"-F 'qqfile=@./build/android/bin/YOURAPPNAME.apk' " + // Insert your IPA file name | |
"-F 'releaseNotes=<%= installr_settings.releaseNotes %>' " + // release notes pulled from installr_settings above | |
"-F 'notify=true'" | |
].join("&&") | |
} | |
}, | |
}); | |
// Load plugins | |
grunt.loadNpmTasks('grunt-titanium'); | |
grunt.loadNpmTasks('grunt-shell'); | |
grunt.registerTask('default', ['titanium', 'shell']); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment