Add release script.

This commit is contained in:
László Monda
2017-11-18 18:41:24 +01:00
parent 82675c6f59
commit 7d1ccdaa05
3 changed files with 46 additions and 0 deletions

3
release/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
node_modules
package-lock.json
uhk-bootloader-*.hex

26
release/make-release.js Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env node
const fs = require('fs');
require('shelljs/global');
config.fatal = true;
config.verbose = true;
const bootloaderHex = `${__dirname}/../targets/MK22F51212/kds/freedom_bootloader/release/freedom_bootloader.hex`;
const targetConfigH = `${__dirname}/../targets/MK22F51212/src/target_config.h`
const targetConfigHContent = fs.readFileSync(targetConfigH, 'utf8');
const majorNumber = targetConfigHContent.match(/kTarget_Version_Major = ([0-9]+)/)[1];
const minorNumber = targetConfigHContent.match(/kTarget_Version_Minor = ([0-9]+)/)[1];
const patchNumber = targetConfigHContent.match(/kTarget_Version_Bugfix = ([0-9]+)/)[1];
rm('-f', bootloaderHex);
exec(`/opt/Freescale/KDS_v3/eclipse/kinetis-design-studio \
--launcher.suppressErrors \
-noSplash \
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
-import ${__dirname}/../targets/MK22F51212/kds/freedom_bootloader \
-cleanBuild freedom_bootloader`
);
cp(bootloaderHex, `uhk-bootloader-${majorNumber}.${minorNumber}.${patchNumber}.hex`);

17
release/package.json Normal file
View File

@@ -0,0 +1,17 @@
{
"name": "uhk-bootloader",
"homepage": "https://UltimateHackingKeyboard.com",
"description": "The bootloader of the Ultimate Hacking Keyboard",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/UltimateHackingKeyboard/bootloader.git"
},
"author": "Ultimate Gadget Laboratories",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/UltimateHackingKeyboard/bootloader/issues"
},
"dependencies": {
"shelljs": "^0.7.8"
}
}