diff --git a/tools/beta-release/app.js b/tools/beta-release/app.js index 4adb27e..a139328 100644 --- a/tools/beta-release/app.js +++ b/tools/beta-release/app.js @@ -135,11 +135,22 @@ const createBranch = async (github, branchName, fromBranch) => { const incrementVersionFile = async (github, branchName) => { const versionFile = await readVersionFile(github, branchName) + const [date, rc] = versionFile.content.name.split("-V") + const today = new Date().toLocaleDateString("en-GB") + + let updatedVersionName = undefined + if (today == date) { + updatedVersionName = `${date}-V${rc + 1}` + } else { + updatedVersionName = `${today}-V1` + } const updatedVersionFile = { - ...versionFile.content, code: versionFile.content.code + 1, + name: updatedVersionName, } + + const encodedContentUpdate = Buffer.from(JSON.stringify(updatedVersionFile, null, 2)).toString('base64') await github.rest.repos.createOrUpdateFileContents({ owner: config.owner, diff --git a/version.json b/version.json index 60997cb..25f9121 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "name": "0.0.1-alpha04", + "name": "31/08/2022-V1", "code": 7 } \ No newline at end of file