@@ -101,6 +101,8 @@ static void PostBuild(BuildSequence sequence) {
101
101
string changelogContent = "" ;
102
102
string readmeContent = usedChangelog . readme ;
103
103
104
+ bool isAnyReleaseBuild = false ;
105
+
104
106
if ( isNeedChangelogFile ) {
105
107
StringBuilder sb = new StringBuilder ( ) ;
106
108
@@ -161,6 +163,8 @@ static void PostBuild(BuildSequence sequence) {
161
163
162
164
if ( ! string . IsNullOrEmpty ( buildsPath [ i ] ) ) {
163
165
if ( sequence . builds [ i ] . isReleaseBuild ) { //Destroy IL2CPP junk after build
166
+ isAnyReleaseBuild = true ;
167
+
164
168
string buildRootPath = Path . GetDirectoryName ( buildsPath [ i ] ) ;
165
169
string [ ] dirs = Directory . GetDirectories ( buildRootPath ) ;
166
170
var il2cppDirs = dirs . Where ( s => s . Contains ( "BackUpThisFolder_ButDontShipItWithYourGame" ) ) ;
@@ -205,6 +209,34 @@ static void PostBuild(BuildSequence sequence) {
205
209
}
206
210
}
207
211
}
212
+
213
+ if ( isAnyReleaseBuild ) {
214
+ string gitRootPath = Path . Combine ( Application . dataPath , ".." ) ;
215
+
216
+ if ( ! Directory . Exists ( Path . Combine ( gitRootPath , ".git" ) ) ) {
217
+ gitRootPath = Path . Combine ( gitRootPath , ".." ) ;
218
+
219
+ if ( ! Directory . Exists ( Path . Combine ( gitRootPath , ".git" ) ) ) {
220
+ gitRootPath = null ;
221
+ }
222
+ }
223
+
224
+ if ( gitRootPath != null ) {
225
+ if ( isNeedChangelogFile ) {
226
+ File . WriteAllText (
227
+ Path . Combine ( gitRootPath , "Changelog.md" ) ,
228
+ changelogContent
229
+ ) ;
230
+ }
231
+
232
+ if ( isNeedReadmeFile ) {
233
+ File . WriteAllText (
234
+ Path . Combine ( gitRootPath , "ReadmeGame.md" ) ,
235
+ readmeContent
236
+ ) ;
237
+ }
238
+ }
239
+ }
208
240
}
209
241
210
242
static void Compress ( BuildSequence sequence ) {
0 commit comments