Skip to content

Commit f2d8b01

Browse files
committed
build(msix/ci): Add MSIX packaging support and update CI build process
- Added a full set of application icon resources and MSIX packaging configuration files - Adjust the existing packaging configuration items in the main project's csproj - Refactor the release workflow to support building MSIX packages for multiple architectures
1 parent 4d57b64 commit f2d8b01

11 files changed

Lines changed: 144 additions & 14 deletions

.github/workflows/release.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,22 +200,44 @@ jobs:
200200
DISPLAY_NAME: ${{ env.DISPLAY_NAME }}
201201
PUBLISHER_ID: ${{ env.PUBLISHER_ID }}
202202
run: |
203-
$manifestPath = "Package.appxmanifest"
203+
$manifestPath = "DevTools.Package\Package.appxmanifest"
204204
$manifestContent = Get-Content $manifestPath -Raw
205205
$manifestContent = $manifestContent -replace '\$PACKAGE_NAME\$', "${{ env.PACKAGE_NAME }}"
206206
$manifestContent = $manifestContent -replace '\$PUBLISHER_ID\$', "${{ env.PUBLISHER_ID }}"
207207
$manifestContent = $manifestContent -replace '\$DISPLAY_NAME\$', "${{ env.DISPLAY_NAME }}"
208-
$manifestContent = $manifestContent -replace 'Version="\d+\.\d+\.\d+\.\d+"', "Version=`"${{ env.VERSION }}.0`""
208+
$manifestContent = $manifestContent -replace 'Version="\$VERSION\$"', "Version=`"${{ env.VERSION }}.0`""
209+
$manifestContent = $manifestContent -replace '\$ARCHITECTURE\$', "x64"
209210
Set-Content $manifestPath -Value $manifestContent -Encoding UTF8
210211
211-
- name: Dump MSBuild properties
212+
- name: Find MSBuild
213+
id: find-msbuild
212214
shell: pwsh
213215
run: |
214-
dotnet msbuild DevTools.csproj /pp:expanded.xml
215-
Select-String -Path expanded.xml -Pattern "GenerateAppxPackageOnBuild|WindowsPackageType|EnableMsixTooling"
216+
$msbuild = Get-ChildItem -Path "C:\Program Files (x86)\Microsoft Visual Studio" -Recurse -Filter "MSBuild.exe" -ErrorAction SilentlyContinue | Where-Object { $_.FullName -match "\\Bin\\MSBuild\.exe$" } | Sort-Object { $_.FullName } -Descending | Select-Object -First 1
217+
if ($msbuild) {
218+
Write-Host "MSBuild found: $($msbuild.FullName)"
219+
"MSBUILD=$($msbuild.FullName)" >> $env:GITHUB_OUTPUT
220+
} else {
221+
Write-Error "MSBuild not found"
222+
exit 1
223+
}
224+
225+
- name: Build MSIX x64
226+
run: |
227+
(Get-Content "DevTools.Package\Package.appxmanifest") -replace 'ProcessorArchitecture="[^"]*"', 'ProcessorArchitecture="x64"' | Set-Content "DevTools.Package\Package.appxmanifest"
228+
& ${{ steps.find-msbuild.outputs.MSBUILD }} DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=x64 /p:AppxPackageDir=AppPackages\x64\
229+
shell: pwsh
216230

217-
- name: Build and generate MSIX
218-
run: dotnet msbuild DevTools.csproj /p:Configuration=Release /p:GenerateAppxPackageOnBuild=true /p:UapAppxPackageBuildMode=StoreUpload
231+
- name: Build MSIX x86
232+
run: |
233+
(Get-Content "DevTools.Package\Package.appxmanifest") -replace 'ProcessorArchitecture="[^"]*"', 'ProcessorArchitecture="x86"' | Set-Content "DevTools.Package\Package.appxmanifest"
234+
& ${{ steps.find-msbuild.outputs.MSBUILD }} DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=x86 /p:AppxPackageDir=AppPackages\x86\
235+
shell: pwsh
236+
237+
- name: Build MSIX arm64
238+
run: |
239+
(Get-Content "DevTools.Package\Package.appxmanifest") -replace 'ProcessorArchitecture="[^"]*"', 'ProcessorArchitecture="arm64"' | Set-Content "DevTools.Package\Package.appxmanifest"
240+
& ${{ steps.find-msbuild.outputs.MSBUILD }} DevTools.Package\DevTools.Package.wapproj /p:Configuration=Release /p:Platform=arm64 /p:AppxPackageDir=AppPackages\arm64\
219241
shell: pwsh
220242

221243
- name: Show output
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
4+
<VisualStudioVersion>15.0</VisualStudioVersion>
5+
</PropertyGroup>
6+
<ItemGroup Label="ProjectConfigurations">
7+
<ProjectConfiguration Include="Debug|x64">
8+
<Configuration>Debug</Configuration>
9+
<Platform>x64</Platform>
10+
</ProjectConfiguration>
11+
<ProjectConfiguration Include="Release|x64">
12+
<Configuration>Release</Configuration>
13+
<Platform>x64</Platform>
14+
</ProjectConfiguration>
15+
<ProjectConfiguration Include="Debug|x86">
16+
<Configuration>Debug</Configuration>
17+
<Platform>x86</Platform>
18+
</ProjectConfiguration>
19+
<ProjectConfiguration Include="Release|x86">
20+
<Configuration>Release</Configuration>
21+
<Platform>x86</Platform>
22+
</ProjectConfiguration>
23+
<ProjectConfiguration Include="Debug|arm64">
24+
<Configuration>Debug</Configuration>
25+
<Platform>arm64</Platform>
26+
</ProjectConfiguration>
27+
<ProjectConfiguration Include="Release|arm64">
28+
<Configuration>Release</Configuration>
29+
<Platform>arm64</Platform>
30+
</ProjectConfiguration>
31+
</ItemGroup>
32+
<PropertyGroup>
33+
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
34+
</PropertyGroup>
35+
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
36+
<PropertyGroup>
37+
<ProjectGuid>a1b2c3d4-e5f6-7890-abcd-ef1234567890</ProjectGuid>
38+
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
39+
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
40+
<DefaultLanguage>en-US</DefaultLanguage>
41+
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
42+
<GenerateAppInstallerFile>false</GenerateAppInstallerFile>
43+
<AppxAutoIncrementPackageRevision>false</AppxAutoIncrementPackageRevision>
44+
<AppxSymbolPackageEnabled>false</AppxSymbolPackageEnabled>
45+
<GenerateTestArtifacts>false</GenerateTestArtifacts>
46+
<AppxBundle>Never</AppxBundle>
47+
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
48+
</PropertyGroup>
49+
<ItemGroup>
50+
<AppxManifest Include="Package.appxmanifest">
51+
<SubType>Designer</SubType>
52+
</AppxManifest>
53+
</ItemGroup>
54+
<ItemGroup>
55+
<ProjectReference Include="DevTools.csproj">
56+
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
57+
</ProjectReference>
58+
</ItemGroup>
59+
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
60+
</Project>
1.48 MB
Loading
1.48 MB
Loading
1.48 MB
Loading
1.48 MB
Loading
1.48 MB
Loading
1.48 MB
Loading
1.48 MB
Loading
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
3+
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
4+
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
5+
IgnorableNamespaces="uap rescap">
6+
7+
<Identity Name="$PACKAGE_NAME$"
8+
Publisher="$PUBLISHER_ID$"
9+
Version="$VERSION$"
10+
ProcessorArchitecture="$ARCHITECTURE$" />
11+
12+
<Properties>
13+
<DisplayName>$DISPLAY_NAME$</DisplayName>
14+
<PublisherDisplayName>Sunquakes</PublisherDisplayName>
15+
<Logo>Images\StoreLogo.png</Logo>
16+
<Description>Developer Tools Collection</Description>
17+
</Properties>
18+
19+
<Dependencies>
20+
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.22621.0" />
21+
</Dependencies>
22+
23+
<Resources>
24+
<Resource Language="en-us" />
25+
<Resource Language="zh-cn" />
26+
</Resources>
27+
28+
<Applications>
29+
<Application Id="App"
30+
Executable="DevTools.exe"
31+
EntryPoint="Windows.FullTrustApplication">
32+
<uap:VisualElements DisplayName="$DISPLAY_NAME$"
33+
Description="Developer Tools Collection"
34+
BackgroundColor="transparent"
35+
Square150x150Logo="Images\Square150x150Logo.png"
36+
Square44x44Logo="Images\Square44x44Logo.png">
37+
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png"
38+
Square71x71Logo="Images\Square71x71Logo.png"
39+
Square310x310Logo="Images\Square310x310Logo.png">
40+
<uap:ShowNameOnTiles>
41+
<uap:ShowOn Tile="square150x150Logo" />
42+
<uap:ShowOn Tile="wide310x150Logo" />
43+
<uap:ShowOn Tile="square310x310Logo" />
44+
</uap:ShowNameOnTiles>
45+
</uap:DefaultTile>
46+
<uap:SplashScreen Image="Images\SplashScreen.png" />
47+
</uap:VisualElements>
48+
</Application>
49+
</Applications>
50+
51+
<Capabilities>
52+
<rescap:Capability Name="runFullTrust" />
53+
</Capabilities>
54+
55+
</Package>

0 commit comments

Comments
 (0)