From 5911e10c251a0fad90b040d4dc81570ecb6f716c Mon Sep 17 00:00:00 2001 From: Martin Schlegel Date: Thu, 30 Mar 2023 16:51:56 +0200 Subject: [PATCH] Release V2.2.1 --- bigCheckMark.svg | 132 ----------------- dt2.lpi | 2 +- makeRelease.mnh | 69 +++++++++ workspaceStateTransitions.graphml | 228 ------------------------------ 4 files changed, 70 insertions(+), 361 deletions(-) delete mode 100644 bigCheckMark.svg create mode 100644 makeRelease.mnh delete mode 100644 workspaceStateTransitions.graphml diff --git a/bigCheckMark.svg b/bigCheckMark.svg deleted file mode 100644 index e2fd3bd..0000000 --- a/bigCheckMark.svg +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - - - - - - - - - - - - - - x - x - - diff --git a/dt2.lpi b/dt2.lpi index 767d70f..57d8c6d 100644 --- a/dt2.lpi +++ b/dt2.lpi @@ -23,7 +23,7 @@ - + diff --git a/makeRelease.mnh b/makeRelease.mnh new file mode 100644 index 0000000..a1ae024 --- /dev/null +++ b/makeRelease.mnh @@ -0,0 +1,69 @@ +LAZ_BUILD:='..\lazarus64\lazbuild.exe'; +LPI:='dt2.lpi'; +BUILD_MODE:='--bm=opt'; + +memoized getVersionFromLPI-> + begin + local lpiLines:=fileLines('dt2.lpi'); + [lpiLines.filter((l)->l.matches('MajorVersionNr'))[0] orElse '', + lpiLines.filter((l)->l.matches('MinorVersionNr'))[0] orElse '', + lpiLines.filter((l)->l.matches('RevisionNr' ))[0] orElse ''] + .split('"').softCast.map((l)->l.filter(::isInt)[0] orElse '?').join('.'); + end; + +patchAbout->begin + local lines:=fileLines('aboutUi.lfm'); + local toPatch:=indexOf(lines.matches('Digitaltrainer Version \d+\.\d+\.\d+')); + assert(toPatch.size=1); + toPatch:=toPatch[0]; + lines[toPatch]:=regex.replace(lines[toPatch],'Digitaltrainer Version \d+\.\d+\.\d+','Digitaltrainer Version '&getVersionFromLPI); + writeFileLines('aboutUi.lfm',lines); +end; + +patchInstallerScript->begin + local lines:=fileLines('installer\installer.iss'); + local toPatch:=indexOf(lines.matches('AppVersion=\d+\.\d+\.\d+')); + assert(toPatch.size=1); + toPatch:=toPatch[0]; + lines[toPatch]:=regex.replace(lines[toPatch],'AppVersion=\d+\.\d+\.\d+','AppVersion='&getVersionFromLPI); + writeFileLines('installer\installer.iss',lines); +end; + +main->begin + log('Current version: ',getVersionFromLPI); + local existentTags:=exec('git',['tag'])[0]; + local matchingTag :=existentTags[existentTags.matches(getVersionFromLPI)][0]; + matchingTag.isVoid + ? begin + log('Matching tag : '); + end + : begin + log('Matching tag : ',matchingTag); + log('Done.'); + halt; + end; + log('Patching about'); + patchAbout; + log('Patching installer script'); + patchInstallerScript; + log('Building'); + assert(teeExec(LAZ_BUILD,[LPI,BUILD_MODE])[1]==0,'Build failed'); + + changeDirectory('installer'); + log('Creating installer'); + assert(teeExec('c:\Program Files (x86)\Inno Setup 6\ISCC.exe',['installer.iss'])[1]==0,'Build failed'); + changeDirectory('..'); + + log('Staging everything...'); + teeExec('git',['stage','*']); + + log('Committing...'); + teeExec('git',['commit','-m',"Release V"&getVersionFromLPI]); + + log('Creating Tag...'); + teeExec('git',['tag','V'&getVersionFromLPI]); + + log("Done.\n", + 'Please review the generated changes before comitting.'); +end; + diff --git a/workspaceStateTransitions.graphml b/workspaceStateTransitions.graphml deleted file mode 100644 index 55aaf68..0000000 --- a/workspaceStateTransitions.graphml +++ /dev/null @@ -1,228 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - solving challenge - - - - - - - - - - - editing palette entry - - - - - - - - - - - editing challenge - - - - - - - - - - - editing new board - - - - - - - - - - - - - ignore -(is this even possible?) - - - - - - - - - - - - - ignore - - - - - - - - - - - - - push - - - - - - - - - - - - - push - - - - - - - - - - - push - - - - - - - - - - - push - - - - - - - - - - - clear - - - - - - - - - - - clear - - - - - - - - - - - push - - - - - - - - - - - clear - - - - - - - - - - - push - - - - - - - - - - - push - - - - - - - - - - - clear - - - - - - - - - - - push - - - - - - - - -