File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 5555 build-linux :
5656 runs-on : ubuntu-22.04
5757
58+ needs : [build-windows]
59+
5860 permissions :
5961 contents : write
6062
6466 uses : actions/setup-dotnet@v4
6567 with :
6668 dotnet-version : 9.0.x
69+ - name : Update VersionOverride in source file
70+ run : |
71+ VERSION="${{ needs.build-windows.outputs.version-number }}"
72+ FILE="MSUScripter/App.axaml.cs"
73+ sed -i "s|private static readonly string\? VersionOverride = null;|private static readonly string? VersionOverride = \"${VERSION}\";|" "$FILE"
74+ echo "Updated VersionOverride to: ${VERSION}"
6775 - name : Install PupNet
6876 run : dotnet tool install -g KuiperZone.PupNet
6977 - name : Download AppImageTool
Original file line number Diff line number Diff line change @@ -14,13 +14,14 @@ namespace MSUScripter;
1414public partial class App : Application
1515{
1616 public static MainWindow MainWindow = null ! ;
17+ private static readonly string ? VersionOverride = null ;
1718
1819 public static string Version
1920 {
2021 get
2122 {
2223 var version = FileVersionInfo . GetVersionInfo ( Assembly . GetEntryAssembly ( ) ! . Location ) ;
23- return ( version . ProductVersion ?? "" ) . Split ( "+" ) [ 0 ] ;
24+ return VersionOverride ?? ( version . ProductVersion ?? "" ) . Split ( "+" ) [ 0 ] ;
2425 }
2526 }
2627
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public class ApplicationInitializationService(ILogger<ApplicationInitializationS
1414 public void Initialize ( )
1515 {
1616 logger . LogInformation ( "Assembly Location: {Location}" , Assembly . GetExecutingAssembly ( ) . Location ) ;
17- logger . LogInformation ( "Starting MSU Scripter {Version}" , GetAppVersion ( ) ) ;
17+ logger . LogInformation ( "Starting MSU Scripter {Version}" , App . Version ) ;
1818
1919 var msuInitializationRequest = new MsuRandomizerInitializationRequest
2020 {
@@ -29,10 +29,4 @@ public void Initialize()
2929 Program . MainHost . Services . GetRequiredService < IMsuRandomizerInitializationService > ( ) . Initialize ( msuInitializationRequest ) ;
3030
3131 }
32-
33- private static string GetAppVersion ( )
34- {
35- var version = FileVersionInfo . GetVersionInfo ( Assembly . GetEntryAssembly ( ) ! . Location ) ;
36- return ( version . ProductVersion ?? "" ) . Split ( "+" ) [ 0 ] ;
37- }
3832}
You can’t perform that action at this time.
0 commit comments