Skip to content

Commit

Permalink
Add release script.
Browse files Browse the repository at this point in the history
  • Loading branch information
mondalaci committed Nov 18, 2017
1 parent 82675c6 commit 7d1ccda
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
3 changes: 3 additions & 0 deletions release/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
package-lock.json
uhk-bootloader-*.hex
26 changes: 26 additions & 0 deletions release/make-release.js
Original file line number Diff line number Diff line change
@@ -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 changes: 17 additions & 0 deletions release/package.json
Original file line number Diff line number Diff line change
@@ -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://[email protected]/UltimateHackingKeyboard/bootloader.git"
},
"author": "Ultimate Gadget Laboratories",
"license": "GPL-3.0",
"bugs": {
"url": "https://github.com/UltimateHackingKeyboard/bootloader/issues"
},
"dependencies": {
"shelljs": "^0.7.8"
}
}

0 comments on commit 7d1ccda

Please sign in to comment.