Skip to content

Commit 7d1ccda

Browse files
committed
Add release script.
1 parent 82675c6 commit 7d1ccda

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

release/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
package-lock.json
3+
uhk-bootloader-*.hex

release/make-release.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env node
2+
const fs = require('fs');
3+
require('shelljs/global');
4+
5+
config.fatal = true;
6+
config.verbose = true;
7+
8+
const bootloaderHex = `${__dirname}/../targets/MK22F51212/kds/freedom_bootloader/release/freedom_bootloader.hex`;
9+
const targetConfigH = `${__dirname}/../targets/MK22F51212/src/target_config.h`
10+
const targetConfigHContent = fs.readFileSync(targetConfigH, 'utf8');
11+
12+
const majorNumber = targetConfigHContent.match(/kTarget_Version_Major = ([0-9]+)/)[1];
13+
const minorNumber = targetConfigHContent.match(/kTarget_Version_Minor = ([0-9]+)/)[1];
14+
const patchNumber = targetConfigHContent.match(/kTarget_Version_Bugfix = ([0-9]+)/)[1];
15+
16+
rm('-f', bootloaderHex);
17+
18+
exec(`/opt/Freescale/KDS_v3/eclipse/kinetis-design-studio \
19+
--launcher.suppressErrors \
20+
-noSplash \
21+
-application org.eclipse.cdt.managedbuilder.core.headlessbuild \
22+
-import ${__dirname}/../targets/MK22F51212/kds/freedom_bootloader \
23+
-cleanBuild freedom_bootloader`
24+
);
25+
26+
cp(bootloaderHex, `uhk-bootloader-${majorNumber}.${minorNumber}.${patchNumber}.hex`);

release/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "uhk-bootloader",
3+
"homepage": "https://UltimateHackingKeyboard.com",
4+
"description": "The bootloader of the Ultimate Hacking Keyboard",
5+
"repository": {
6+
"type": "git",
7+
"url": "git+ssh://git@github.com/UltimateHackingKeyboard/bootloader.git"
8+
},
9+
"author": "Ultimate Gadget Laboratories",
10+
"license": "GPL-3.0",
11+
"bugs": {
12+
"url": "https://github.com/UltimateHackingKeyboard/bootloader/issues"
13+
},
14+
"dependencies": {
15+
"shelljs": "^0.7.8"
16+
}
17+
}

0 commit comments

Comments
 (0)