Skip to content

Commit 0f9389d

Browse files
committed
fix: build version in manifest
1 parent 3e4cc5c commit 0f9389d

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

RELEASE_NOTES.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
1.3.0 - 27 Feb 2022
1+
## 1.3.1 - 27 Feb 2022
2+
- Fix version in manifest.json
3+
4+
## 1.3.0 - 27 Feb 2022
25
- Improved Host validation pattern
36
- Improved PI error messages
47
- Relaxed Homebridge schema requirements
58
- Fallback for layout unavailability
69
- Exception analytics
710
- Dependencies update
811

9-
1.2.0 - 9 Feb 2022
12+
## 1.2.0 - 9 Feb 2022
1013
- New accessory selector show all accessories and disable not compatible accessories
1114
- Added support for accessories outside of room layout
1215
- Added loading indicator when waiting for Homebridge responses
1316
- Added reset button option when device is no longer available
1417
- Added timeouts for Homebridge API calls
1518
- Improved error handling and user error message
1619

17-
1.1.0 - 29 Jan 2022
20+
## 1.1.0 - 29 Jan 2022
1821
- Added `Set state` action
1922

20-
1.0.0 - 27 Jan 2022
23+
## 1.0.0 - 27 Jan 2022
2124
- Initial release
2225
- Added `Switch` action that allow you toggle on/off you accessories or their features
2326
- Added `Config UI` action open web ui of connected Homebridge server

build.fsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ open Fake.Core
2222
open Fake.Core.TargetOperators
2323
open Fake.IO
2424
open System
25+
open System.IO
2526

2627
let bin = "bin"
2728
let name = "com.sergeytihon.homebridge.sdPlugin"
29+
30+
let releaseNotesData =
31+
File.ReadAllLines "RELEASE_NOTES.md"
32+
|> ReleaseNotes.parseAll
33+
let release = List.head releaseNotesData
34+
2835
let macTarget =
2936
IO.Path.Combine(
3037
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
@@ -44,8 +51,24 @@ Target.create "NpmInstall" (fun _ ->
4451
| code -> failwithf "build failed with code %d" code
4552
)
4653

54+
let setManifestJsonField fieldName value =
55+
let fileName = Path.Combine( __SOURCE_DIRECTORY__, "src", name, "manifest.json")
56+
57+
let lines =
58+
File.ReadAllLines fileName
59+
|> Seq.map (fun line ->
60+
if line.TrimStart().StartsWith($"\"{fieldName}\":") then
61+
let indent = line.Substring(0, line.IndexOf("\""))
62+
sprintf "%s\"%s\": %s," indent fieldName value
63+
else
64+
line)
65+
66+
File.WriteAllLines(fileName, lines)
4767

4868
Target.create "Build" (fun _ ->
69+
let versionString = $"\"{release.NugetVersion}\""
70+
setManifestJsonField "Version" versionString
71+
4972
Shell.copyDir $"bin/{name}" $"src/{name}" (fun s -> not <| s.Contains("/js/"))
5073
Shell.Exec("npm", "run build")
5174
|> function

src/com.sergeytihon.homebridge.sdPlugin/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"Name": "Homebridge",
5353
"Icon": "resources/pluginIcon",
5454
"URL": "https://github.com/sergey-tihon/streamdeck-homebridge",
55-
"Version": "1.2.0",
55+
"Version": "1.3.1",
5656
"Category": "Homebridge",
5757
"CategoryIcon": "resources/pluginIcon",
5858
"OS": [
@@ -68,4 +68,4 @@
6868
"Software": {
6969
"MinimumVersion": "4.1"
7070
}
71-
}
71+
}

0 commit comments

Comments
 (0)