Skip to content

Commit

Permalink
Fix so we only change version info on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Oct 13, 2024
1 parent 9a827e6 commit ff8967c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 9 additions & 6 deletions build/BuildToolsTasks/BuildMGCBEditorTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ public sealed class BuildMGCBEditorTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.ReplaceRegexInFiles(
"Tools/MonoGame.Content.Builder.Editor/Info.plist",
@"<key>CFBundleShortVersionString<\/key>\s*<string>([^\s]*)<\/string>",
$"<key>CFBundleShortVersionString</key>\n\t<string>{context.Version}</string>",
RegexOptions.Singleline
);
if (context.BuildSystem().IsRunningOnGitHubActions)
{
context.ReplaceRegexInFiles(
"Tools/MonoGame.Content.Builder.Editor/Info.plist",
@"<key>CFBundleShortVersionString<\/key>\s*<string>([^\s]*)<\/string>",
$"<key>CFBundleShortVersionString</key>\n\t<string>{context.Version}</string>",
RegexOptions.Singleline
);
}

var platform = context.Environment.Platform.Family switch
{
Expand Down
15 changes: 9 additions & 6 deletions build/BuildToolsTasks/BuildMGCBTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ public sealed class BuildMGCBTask : FrostingTask<BuildContext>
{
public override void Run(BuildContext context)
{
context.ReplaceRegexInFiles(
"Tools/MonoGame.Content.Builder.Task/MonoGame.Content.Builder.Task.props",
@"<MonoGameVersion>([^\s]*)<\/MonoGameVersion>",
$"<MonoGameVersion>{context.Version}</MonoGameVersion>",
RegexOptions.Singleline
);
if (context.BuildSystem().IsRunningOnGitHubActions)
{
context.ReplaceRegexInFiles(
"Tools/MonoGame.Content.Builder.Task/MonoGame.Content.Builder.Task.props",
@"<MonoGameVersion>([^\s]*)<\/MonoGameVersion>",
$"<MonoGameVersion>{context.Version}</MonoGameVersion>",
RegexOptions.Singleline
);
}
context.DotNetPack(context.GetProjectPath(ProjectType.Tools, "MonoGame.Content.Builder"), context.DotNetPackSettings);
context.DotNetPack(context.GetProjectPath(ProjectType.Tools, "MonoGame.Content.Builder.Task"), context.DotNetPackSettings);
}
Expand Down

0 comments on commit ff8967c

Please sign in to comment.