Skip to content

Commit e0c70bf

Browse files
committed
Version 1.55.0
2 parents 42807ba + 262dbd1 commit e0c70bf

File tree

78 files changed

+378504
-257716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+378504
-257716
lines changed

BuildTools/DEPLOY.BAT

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
@REM -- DON'T TOUCH -------------------------
2+
@echo off
3+
setlocal
4+
set SCRIPT_PATH=%~dp0
5+
set SCRIPT_PATH=%SCRIPT_PATH:~0,-1%
6+
set SCRIPT_NAME=%~n0
7+
REM ----------------------------------------
8+
9+
REM CONFIGURABLES
10+
11+
REM Change these if you have forked the project.
12+
set GITHUB_USER=monkeyman192
13+
set GITHUB_REPO=MBINCompiler
14+
15+
REM Probably don't want to change these.
16+
set REL_BRANCH=master
17+
set PRE_BRANCH=development
18+
19+
REM -- DON'T TOUCH -------------------------
20+
set MSG=%*
21+
if "%MSG%" == "" goto HELP
22+
23+
if "%GITHUB_TOKEN%" == "" goto INVALID_TOKEN
24+
25+
set REPO=%GITHUB_USER%/%GITHUB_REPO%
26+
27+
REM back out of .\BuildTools
28+
set PROJECT_PATH=%SCRIPT_PATH%\..
29+
set BUILD_PATH=%PROJECT_PATH%\Build\Release
30+
31+
set EXE_ARTIFACT=%BUILD_PATH%\MBINCompiler.exe
32+
set DLL_ARTIFACT=%BUILD_PATH%\libMBIN.dll
33+
34+
set OPT_PRERELEASE=-prerelease
35+
set BRANCH=%PRE_BRANCH%
36+
37+
for /f "tokens=1,2,3,4,5,6" %%I in ('call "_lib\libMBIN-VERSION.BAT"') do (
38+
set TAG=%%I
39+
set VERSION=%%J
40+
set MAJOR=%%K
41+
set MINOR=%%L
42+
set RELEASE=%%M
43+
set PRERELEASE=%%N
44+
)
45+
46+
if %PRERELEASE% == 0 (
47+
if %RELEASE% == 0 goto INVALID_VERSION
48+
set OPT_PRERELEASE=
49+
set BRANCH=%REL_BRANCH%
50+
)
51+
52+
echo TAG=%TAG%
53+
echo VERSION=%VERSION%
54+
55+
REM Check that the build artifacts exist
56+
if not exist "%EXE_ARTIFACT%" goto NOT_COMPILED
57+
if not exist "%DLL_ARTIFACT%" goto NOT_COMPILED
58+
59+
REM Get the version reported from the compiled exe.
60+
for /f %%I in ('"%BUILD_PATH%\MBINCompiler.exe" -v') do set BUILD_VERSION=%%I
61+
62+
REM Debug
63+
REM echo BUILD_VERSION=%BUILD_VERSION%
64+
65+
REM There's no guarantee the exe uses the latest source without building on demand
66+
REM but at least make sure the version in the compiled exe matches the source code.
67+
if not "%BUILD_VERSION%" == "%VERSION%" goto VERSION_MISMATCH
68+
69+
set STAGING_PATH=%SCRIPT_PATH%\DEPLOY.STAGING
70+
71+
REM delete the staging folder, in case it exists
72+
rd /s /q "%STAGING_PATH%" > nul 2>&1
73+
REM copy artifacts to staging folder
74+
md "%STAGING_PATH%"
75+
copy "%EXE_ARTIFACT%" "%STAGING_PATH%\" > nul 2>&1
76+
copy "%DLL_ARTIFACT%" "%STAGING_PATH%\" > nul 2>&1
77+
78+
_bin\github-release %OPT_PRERELEASE% "%REPO%" "v%TAG%" "%BRANCH%" "%MSG%" "%STAGING_PATH%\*"
79+
80+
REM CLEANUP: delete the staging folder and it's contents
81+
rd /s /q "%STAGING_PATH%" > nul 2>&1
82+
83+
exit /b 0
84+
85+
86+
:HELP
87+
echo.%~nx0 ^<RELEASE MESSAGE^>
88+
echo.
89+
echo.Deploys a new release to the github repository (run from command line prompt).
90+
echo.
91+
echo.MAKE SURE libMBIN.Version.VERSION_STRING IS UPDATED!
92+
echo.
93+
echo.MAKE SURE ALL CHANGES ARE COMMITTED AND PUSHED TO THE PROJECT REPOSITORY BEFORE DEPLOYING!
94+
echo.
95+
echo.MAKE SURE THE PROJECT CAN BUILD SUCCESSFULLY BEFORE DEPLOYING!
96+
echo.
97+
echo.Parses VERSION_STRING from libMBIN.Version and converts it to a github tag.
98+
echo.If the Prerelease version number is not 0, then the tag format is "vX.X.X-preX", otherwise just "vX.X.X"
99+
echo.
100+
echo.If the tag already exists in the repository, the release is configured for that commit.
101+
echo.If not, then the latest commit on the release (%REL_BRANCH%) or prerelease (%PRE_BRANCH%) branch will be tagged, depending on the tag format.
102+
echo.
103+
pause
104+
exit /b 1
105+
106+
:INVALID_TOKEN
107+
echo.GITHUB_TOKEN environment variable not configured!
108+
echo.Deploying to github requires an access token.
109+
echo.
110+
echo.NOTE that you must be a project collaborator to be able to deploy to %GITHUB_USER%/%GITHUB_REPO%!
111+
echo.If you want to deploy to your own project, change the GITHUB_USER and GITHUB_REPO variables in this %~nx0 file then follow the below instructions.
112+
echo.
113+
echo.You must configure a GITHUB_TOKEN environment variable and set the value to your personal access token.
114+
echo.In the Windows Start menu search for 'environment' and select 'Edit environment variables for your account'.
115+
echo.Add the variable to the USER Environment variables, not System. Your token is private. The System variables are not!
116+
echo.(Close this console window and open a new one for your changes to work.)
117+
echo.
118+
echo.To create a github token, see here:
119+
echo.https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
120+
echo.
121+
echo.The only token scopes required for this script are repo:status, repo_deployment and public_repo.
122+
echo.For security, it's advisable to have different tokens for different projects/tasks and keep the scope restricted as much as possible.
123+
echo.
124+
echo.DO NOT SHARE YOUR TOKEN.
125+
echo.DO NOT COMMIT!
126+
echo.
127+
pause
128+
exit /b 2
129+
130+
:INVALID_VERSION
131+
echo.
132+
echo.VERSION_STRING = "%VERSION%" is not valid!
133+
echo.
134+
echo.If Release is 0 then Prerelease must not be 0.
135+
echo.Change libMBIN.Version.VERSION_STRING to "%MAJOR%.%MINOR%.0.1"
136+
echo.
137+
pause
138+
exit /b 3
139+
140+
:VERSION_MISMATCH
141+
echo.
142+
echo.libMBIN.Version.VERSION_STRING does not match the compiled version in the Build\Release folder!
143+
echo."%VERSION%" != "%BUILD_VERSION%"
144+
goto NOT_COMPILED
145+
146+
:NOT_COMPILED
147+
echo.
148+
echo.You must compile a release build for the current version before deploying.
149+
echo.
150+
pause
151+
exit /b 4

BuildTools/_bin/github-release.exe

4.81 MB
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@REM -- DON'T TOUCH -------------------------
2+
@echo off
3+
setlocal
4+
set SCRIPT_PATH=%~dp0
5+
set SCRIPT_PATH=%SCRIPT_PATH:~0,-1%
6+
set SCRIPT_NAME=%~n0
7+
REM ----------------------------------------
8+
9+
REM Back out of BuildTools\_lib
10+
set PROJECT_PATH=%SCRIPT_PATH%\..\..
11+
12+
REM Relative to PROJECT_PATH
13+
set VERSION_PATH=libMBIN\Source\Version.cs
14+
15+
for /f "usebackq tokens=4,6 delims=; " %%I in ( "%PROJECT_PATH%\%VERSION_PATH%" ) do if "%%I" == "VERSION_STRING" set VERSION=%%~J
16+
for /f "tokens=1,2,3,4 delims=." %%A in ("%VERSION%") do (
17+
set VERSION_STRING=%%A.%%B.%%C
18+
set MAJOR=%%A
19+
set MINOR=%%B
20+
set RELEASE=%%C
21+
set PRERELEASE=%%D
22+
)
23+
24+
if %PRERELEASE% GTR 0 set SUFFIX=-pre%PRERELEASE%
25+
26+
echo %VERSION_STRING%%SUFFIX% %VERSION% %MAJOR% %MINOR% %RELEASE% %PRERELEASE%
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@cmd

CheckForCompile.ps1

Lines changed: 0 additions & 63 deletions
This file was deleted.

FilesNotDeCompiling.md

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)