-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_robohelp_gh.bat
More file actions
145 lines (120 loc) · 4.43 KB
/
Copy pathbuild_robohelp_gh.bat
File metadata and controls
145 lines (120 loc) · 4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
@echo on
setlocal enabledelayedexpansion
rem experimental build
if "%WORKSPACE%" == "" set WORKSPACE=%GITHUB_WORKSPACE%
if "%BUILD_NUMBER%" == "" set BUILD_NUMBER=999
if "%SOURCE_BUILD_NUMBER%" == "" set SOURCE_BUILD_NUMBER=%BUILD_NUMBER%
if "%SOURCE_MAJOR_VERSION%" == "" set SOURCE_MAJOR_VERSION=1
if "%SOURCE_MINOR_VERSION%" == "" set SOURCE_MINOR_VERSION=0
if "%JOB_NAME%" == "" set JOB_NAME=GMS2_Manual
set BUILDTYPE=release
set BUILDPLATFORM="Any CPU"
set BUILDCLEAN=1
set BUILDBETA=%BUILDBETA%
set S3_BUCKET=%S3_BUCKET%
set ZIP_FILE=%ZIP_FILE%
set LANGUAGE=%LANGUAGE%
set basedir=%~dp0
:check_options
if %LANGUAGE%==EN (
if "%BUILDBETA%"=="1" (
set robohelpPreset="GMS2 Manual Responsive HTML5 BETA"
) else (
set robohelpPreset="GMS2 Manual Responsive HTML5"
)
goto finish_options
) else if %LANGUAGE%==ES (
set robohelpPreset="GMS2 Manual Spanish"
goto finish_options
) else if %LANGUAGE%==FR (
set robohelpPreset="GMS2 Manual French"
goto finish_options
) else if %LANGUAGE%==DE (
set robohelpPreset="GMS2 Manual German"
goto finish_options
) else if %LANGUAGE%==RU (
set robohelpPreset="GMS2 Manual Russian"
goto finish_options
) else if %LANGUAGE%==PT-BR (
set robohelpPreset="GMS2 Manual Portuguese (Brazil)"
goto finish_options
) else if %LANGUAGE%==ZH (
set robohelpPreset="GMS2 Manual Chinese (Simplified)"
goto finish_options
) else if %LANGUAGE%==IT (
set robohelpPreset="GMS2 Manual Italian"
goto finish_options
) else if %LANGUAGE%==JA (
set robohelpPreset="GMS2 Manual Japanese"
goto finish_options
) else if %LANGUAGE%==PL (
set robohelpPreset="GMS2 Manual Polish"
goto finish_options
) else if %LANGUAGE%==KO (
set robohelpPreset="GMS2 Manual Korean"
goto finish_options
)else (
set DESTDIR=%1
goto finish_options
)
shift
goto check_options
:finish_options
if "%DESTDIR%" == "" set DESTDIR=%GITHUB_WORKSPACE%\output
rem Pulling Adobe Zip from S3
aws s3 cp %S3_BUCKET%/%ZIP_FILE% %ZIP_FILE%
7z x %ZIP_FILE% -o"%basedir%"
rem Pulling RobohelpTool from S3
aws s3 cp %S3_BUCKET%/RoboHelpTool.exe RoboHelpTool.exe
copy "RoboHelpTool.exe" "%basedir%"
set roboHelpTool="%basedir%Adobe_RoboHelp_2022\RoboHelp.exe"
set helpTagsTool="%basedir%RoboHelpTool.exe"
echo "%robohelpPreset%"
%roboHelpTool% --cl "%basedir%Manual\GMS2_Manual.rhpj" -o %robohelpPreset% -p "%DESTDIR%\RoboHelp"
if not exist "%DESTDIR%\RoboHelp" (
echo "RoboHelp Directory not found - RoboHelp Crashed?"
exit /b 1
)
rem output help tags files
%helpTagsTool% -s="%basedir%Manual\contents" -o="%DESTDIR%\RoboHelp"
rem append css fix to layout.css
type "%basedir%SupportFiles\layout_fix_append.css" >> "%DESTDIR%\RoboHelp\template\Charcoal_Grey\layout.css"
pushd %DESTDIR%\RoboHelp
rem ── Run only in GameMaker-Manual ─────────────────────────────────────
if /i not "%GITHUB_REPOSITORY%"=="YoYoGames/GameMaker-Manual" (
echo Skipping S3 upload — this is not the main GameMaker-Manual repo
goto skip_s3_upload
)
rem ── Determine S3 path based on preset ────────────────────────────────
if /i %robohelpPreset%=="GMS2 Manual Responsive HTML5 BETA" (
set "S3_PATH=%S3_BUCKET%/Beta"
echo Branch is develop - Choose BETA
) else if /i %robohelpPreset%=="GMS2 Manual Responsive HTML5" (
set "S3_PATH=%S3_BUCKET%/Green"
echo Branch is Main - Choose Green
) else (
set "S3_PATH=%S3_BUCKET%/LTS"
echo Branch is neither develop nor main - Choose LTS
)
rem ── Temp directory for comparison ────────────────────────────────────
mkdir "temp_s3_compare" 2>nul
rem ── Download current files from S3 ───────────────────────────────────
for %%F in (helpdocs_keywords.json helpdocs_tags.json) do (
echo Checking %%F...
aws s3 cp "%S3_PATH%/%%F" "temp_s3_compare/%%F" >nul 2>&1
if not exist "temp_s3_compare/%%F" (
echo %%F missing on S3 → uploading
aws s3 cp "%%F" "%S3_PATH%/%%F"
) else (
fc /b "%%F" "temp_s3_compare/%%F" >nul 2>&1 || (
echo %%F changed → uploading
aws s3 cp "%%F" "%S3_PATH%/%%F"
)
)
)
rem Cleanup
rmdir /s /q temp_s3_compare 2>nul
:skip_s3_upload
rem ************************************************** ZIP up the output
7z a YoYoStudioRoboHelp.zip . -r
popd