-
Notifications
You must be signed in to change notification settings - Fork 4
/
release.ps1
32 lines (26 loc) · 939 Bytes
/
release.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Push-Location
Set-Location $PSScriptRoot
$name = '$safeprojectname$'
$assembly = "Community.PowerToys.Run.Plugin.$name"
$version = "v$((Get-Content ./plugin.json | ConvertFrom-Json).Version)"
$archs = @('x64', 'arm64')
$tempDir = "./out/$name"
git tag $version
git push --tags
Remove-Item ./out/*.zip -Recurse -Force -ErrorAction Ignore
foreach ($arch in $archs) {
$releasePath = "./bin/$arch/Release/net8.0-windows"
dotnet build -c Release /p:Platform=$arch
Remove-Item "$tempDir/*" -Recurse -Force -ErrorAction Ignore
mkdir "$tempDir" -ErrorAction Ignore
$items = @(
"$releasePath/$assembly.deps.json",
"$releasePath/$assembly.dll",
"$releasePath/plugin.json",
"$releasePath/Images"
)
Copy-Item $items "$tempDir" -Recurse -Force
Compress-Archive "$tempDir" "./out/$name-$version-$arch.zip" -Force
}
gh release create $version (Get-ChildItem ./out/*.zip)
Pop-Location