Skip to content

Commit

Permalink
Added powershell script to publish and pack all configs
Browse files Browse the repository at this point in the history
  • Loading branch information
giollord committed Feb 27, 2023
1 parent 3c18e2a commit e3457e6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions UnityPackageExtractor/PublishAndPack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$pubProfiles = 'Properties/PublishProfiles'
$pubProfilesCfg = (@"
[
{ "pubxml": "FolderProfile-x86.pubxml", "outDir": "bin/Release/net7.0/publish/win-x86", "archiveName": "win-x86.zip" },
{ "pubxml": "FolderProfile-x64.pubxml", "outDir": "bin/Release/net7.0/publish/win-x64", "archiveName": "win-x64.zip" },
{ "pubxml": "FolderProfile-x86-full.pubxml", "outDir": "bin/Release/net7.0/publish/win-x86-full", "archiveName": "win-x86-full.zip" },
{ "pubxml": "FolderProfile-x64-full.pubxml", "outDir": "bin/Release/net7.0/publish/win-x64-full", "archiveName": "win-x64-full.zip" }
]
"@ | ConvertFrom-Json)
$filesToZip = @('UnityPackageExtractor.exe')
$zipPath = 'bin/Release/net7.0/publish'

foreach($cfg in $pubProfilesCfg) {
dotnet publish "UnityPackageExtractor.csproj" /p:PublishProfile="$pubProfiles/$($cfg.pubxml)"

Compress-Archive -Path ($filesToZip | ForEach-Object { "$($cfg.outDir)/$_" }) -DestinationPath "$zipPath/$($cfg.archiveName)"
}

0 comments on commit e3457e6

Please sign in to comment.