File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ var currentDirectory = Directory . GetCurrentDirectory ( ) ;
2+ Console . WriteLine ( $ "currentDirectory: { currentDirectory } ") ;
3+
4+ var versionPropsFile = "./build/version.props" ;
5+ var doc = System . Xml . Linq . XDocument . Load ( versionPropsFile ) ;
6+ var propertyGroupNode = doc . Element ( "Project" ) . Element ( "PropertyGroup" ) ;
7+
8+ var version = $ "{ propertyGroupNode . Element ( "VersionMajor" ) . Value } .{ propertyGroupNode . Element ( "VersionMinor" ) . Value } .{ propertyGroupNode . Element ( "VersionPatch" ) . Value } ";
9+ Console . WriteLine ( $ "Version: { version } ") ;
10+
11+ var envFile = Environment . GetEnvironmentVariable ( "GITHUB_ENV" ) ;
12+ Console . WriteLine ( $ "EnvFilePath: { envFile } ") ;
13+
14+ if ( string . IsNullOrEmpty ( envFile ) ) return ;
15+
16+ File . WriteAllText ( envFile , $ "ReleaseVersion={ version } ") ;
17+ Console . WriteLine ( File . ReadAllText ( envFile ) ) ;
You can’t perform that action at this time.
0 commit comments