chore: update firmware versions in constants/versions.ts

This commit is contained in:
Ben Allfree
2025-12-09 18:33:30 -08:00
parent 737a6ca993
commit 83dc49dc0d
2 changed files with 37 additions and 242 deletions
+33 -2
View File
@@ -9,6 +9,19 @@ const __dirname = path.dirname(__filename)
const FIRMWARE_DIR = path.resolve(__dirname, "../vendor/firmware")
const OUTPUT_FILE = path.resolve(__dirname, "../constants/versions.ts")
function parseVersion(tag) {
// Extract version from tag (e.g., "v2.6.13.0561f2c" -> {major: 2, minor: 6, patch: 13})
const match = tag.match(/v?(\d+)\.(\d+)\.(\d+)/)
if (match) {
return {
major: parseInt(match[1], 10),
minor: parseInt(match[2], 10),
patch: parseInt(match[3], 10),
}
}
return null
}
function getVersions() {
try {
// Fetch tags from the meshtastic remote
@@ -19,7 +32,7 @@ function getVersions() {
// Filter and sort tags
// We are looking for tags like v2.5.0...
const tags = output
const allTags = output
.split("\n")
.map(tag => tag.trim())
.filter(tag => tag.startsWith("v") && tag.includes("."))
@@ -27,7 +40,25 @@ function getVersions() {
// We want reverse sort to show latest first
.sort((a, b) => b.localeCompare(a, undefined, { numeric: true, sensitivity: "base" }))
return tags
// Filter to only show latest patch versions of 2.6 and 2.7
// Latest patch versions: 2.6.13 and 2.7.16
const supportedVersions = [
{ major: 2, minor: 6, patch: 13 },
{ major: 2, minor: 7, patch: 16 },
]
const isSupportedVersion = tag => {
const version = parseVersion(tag)
if (!version) return false
return supportedVersions.some(
sv => sv.major === version.major && sv.minor === version.minor && sv.patch === version.patch
)
}
// Filter to only supported patch versions
const filteredTags = allTags.filter(tag => isSupportedVersion(tag))
return filteredTags
} catch (error) {
console.error("Error getting git tags:", error)
return []