11use Package .nu package-plugin
22
3- def main [version : string ] {
3+ const ECSACT_SDK_VERSION = " 0.9.0"
4+
5+ def fetch-third-party [] {
6+ let ecsact_sdk_dir = " Source/ThirdParty/EcsactSDK" | path expand ;
7+ rm - rf $ecsact_sdk_dir ;
8+ mkdir $ecsact_sdk_dir ;
9+ let ecsact_sdk_zip = $" https://github.com/ecsact-dev/ecsact_sdk/releases/download/($ECSACT_SDK_VERSION )/ecsact_sdk_($ECSACT_SDK_VERSION )_windows_x64.zip" ;
10+ http get -- raw $ecsact_sdk_zip | tar - x - C $ecsact_sdk_dir ;
11+
12+ # always use our version of EcsactUnrealCodegen incase there's a mismatch on release
13+ cp " Dist/EcsactUnrealCodegen-Win64.exe" ([$ecsact_sdk_dir , " bin" , " EcsactUnrealCodegen.exe" ] | path join );
14+ }
15+
16+ def main [version : string , -- dry ] {
17+ if $dry {
18+ print " dry run - release will not be created" ;
19+ }
420 let plugin_dir = $env .FILE_PWD | path join ' ..' | path expand ;
521 let dist_dir = [$plugin_dir , ' Dist' ] | path join ;
622 rm - rf $dist_dir ;
@@ -19,12 +35,17 @@ def main [version: string] {
1935 cd $ecsact_unreal_codegen_dir ;
2036 ^ bazel run //:CopyDist ;
2137 cd $plugin_dir ;
38+ fetch-third-party ;
2239 package-plugin ;
2340
2441 ls $dist_dir ;
2542
26- git add $plugin_descriptor_filename ;
27- git commit - m $" chore: update version ($version )" ;
28- git push ;
29- gh release create $version -- generate-notes -- latest - t $version Dist/* ;
43+ if not $dry {
44+ git add $plugin_descriptor_filename ;
45+ git commit - m $" chore: update version ($version )" ;
46+ git push ;
47+ gh release create $version -- generate-notes -- latest - t $version Dist/* ;
48+ } else {
49+ print " dry run - release not created" ;
50+ }
3051}
0 commit comments