diff --git a/task/task.json b/task/task.json index 50d72d0..793e9c4 100644 --- a/task/task.json +++ b/task/task.json @@ -12,7 +12,7 @@ "runsOn": ["Agent"], "author": "Rhys Koedijk", "version": { - "Major": 1, + "Major": 0, "Minor": 0, "Patch": 0 }, diff --git a/vss-extension.json b/vss-extension.json index 3b5e531..fac6af8 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -4,7 +4,7 @@ "id": "sbom-tool-local", "name": "SBOM Tool [LOCALHOST]", "description": "SBOM Tool. Generate SPDX 2.2 compatible SBOMs from Azure DevOps repository artifacts.", - "version": "1.0.0", + "version": "0.0.0.0", "public": false, "scopes": ["vso.build"], "targets": [ diff --git a/vss-extension.version.increment.js b/vss-extension.version.increment.js index 49aacbb..3c20f49 100644 --- a/vss-extension.version.increment.js +++ b/vss-extension.version.increment.js @@ -4,14 +4,19 @@ const path = require('path'); function incrementPatchVersion(vssExtensionJsonPath, taskJsonPath) { const vssExtensionJson = JSON.parse(fs.readFileSync(vssExtensionJsonPath)); const taskJson = JSON.parse(fs.readFileSync(taskJsonPath)); - const version = taskJson.version || { Major: 1, Minor: 0, Patch: 0 }; + const version = taskJson.version || { Major: 0, Minor: 0, Patch: 0 }; version.Patch += 1; if (taskJson) { taskJson.version = version; fs.writeFileSync(taskJsonPath, JSON.stringify(taskJson, null, 2)); } if (vssExtensionJson) { - vssExtensionJson.version = taskJson.version.Major + '.' + taskJson.version.Minor + '.' + taskJson.version.Patch; + const revisionTimestamp = new Date() + .toISOString() + .replace(/[^0-9]/g, '') + .slice(3, 12); // YMMDDHHmm + vssExtensionJson.version = + taskJson.version.Major + '.' + taskJson.version.Minor + '.' + taskJson.version.Patch + '.' + revisionTimestamp; fs.writeFileSync(vssExtensionJsonPath, JSON.stringify(vssExtensionJson, null, 2)); } }