-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpackage-and-publish.ps1
62 lines (47 loc) · 2.29 KB
/
package-and-publish.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# TODO
# MSBuild.exe .\Audibly.sln /t:Rebuild /p:Configuration=Release /p:AppxPackageDir="Packages" /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxBundle= /p:GenerateAppxPackageOnBuild=true
$version = "2.1.10.0"
$targetFramework = "net8.0-windows10.0.19041.0"
$packagesDirectory = ".\Packages"
if (!(Test-Path $packagesDirectory)) {
New-Item -ItemType Directory -Path $packagesDirectory
}
$msixDirectory = ".\Packages\msix"
if (!(Test-Path $msixDirectory)) {
New-Item -ItemType Directory -Path $msixDirectory
}
Remove-Item -Path $msixDirectory\* -Recurse -Force
$targetDirectories = @(
".\Audibly.App\bin\ARM64\Release\$targetFramework\AppPackages\",
".\Audibly.App\bin\x64\Release\$targetFramework\AppPackages\",
".\Audibly.App\bin\x86\Release\$targetFramework\AppPackages\"
)
foreach ($targetDirectory in $targetDirectories) {
$versionDirectory = Get-ChildItem -Path $targetDirectory -Directory | Where-Object { $_.Name -match $version }
$versionDirectoryPath = $versionDirectory.FullName
$msixFile = Get-ChildItem -Path $versionDirectoryPath -Filter "*.msix"
Copy-Item -Path $msixFile.FullName -Destination $msixDirectory
}
# create the msixbundle
$msixBundleDirectory = ".\Packages\msixbundle"
if (!(Test-Path $msixBundleDirectory)) {
New-Item -ItemType Directory -Path $msixBundleDirectory
}
$msixBundleFilePath = Join-Path -Path $msixBundleDirectory -ChildPath "Audibly_$version.msixbundle"
# delete the msixbundle if it already exists
if (Test-Path $msixBundleFilePath) {
Remove-Item -Path $msixBundleFilePath -Force
}
MakeAppx bundle /bv $version /d $msixDirectory /p $msixBundleFilePath
# $signedMsixBundleFilePath = Join-Path -Path $msixBundleDirectory -ChildPath "Audibly_Signed_$version.msixbundle"
#
# # make a copy of the msixbundle to sign
# Copy-Item -Path $msixBundleFilePath -Destination $signedMsixBundleFilePath
#
# # Path to the .pfx certificate and its password
# $pfxCertificatePath = ".\Audibly.App\Audibly.App_TemporaryKey.pfx"
# $pfxCertificatePassword = "<password>"
#
# # Sign the msixbundle
# # $signToolPath = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe"
# & signtool.exe sign /fd SHA256 /a /f $pfxCertificatePath /p $pfxCertificatePassword /tr http://timestamp.digicert.com /td SHA256 /debug $signedMsixBundleFilePath