@@ -10,7 +10,8 @@ permissions:
1010 contents : write # Required for creating draft releases
1111
1212env :
13- VERSION : ' ' # Will be set from package.json
13+ VERSION : ' ' # Will be set from package.json (expects 4-part Major.Minor.Build.Revision)
14+ BUILD_MSIX : ' false' # Set to 'true' to enable MSIX package build
1415
1516jobs :
1617 build :
@@ -103,6 +104,55 @@ jobs:
103104 exit 1
104105 }
105106
107+ # ============================================================
108+ # MSIX Package Build (Optional - Controlled by BUILD_MSIX env var)
109+ # ============================================================
110+
111+ - name : Setup MSBuild
112+ if : env.BUILD_MSIX == 'true'
113+ uses : microsoft/setup-msbuild@v2
114+
115+ - name : Build MSIX package
116+ if : env.BUILD_MSIX == 'true'
117+ shell : pwsh
118+ run : |
119+ Write-Host "Building MSIX package for Microsoft Store..." -ForegroundColor Cyan
120+
121+ # MSBuild is now in PATH thanks to setup-msbuild action
122+ # Build MSIX (unsigned for CI - Store will sign it)
123+ msbuild Package\GhostDraw.Package.wapproj `
124+ /p:Configuration=Release `
125+ /p:Platform=x64 `
126+ /p:AppxBundle=Never `
127+ /p:UapAppxPackageBuildMode=SideloadOnly `
128+ /p:AppxPackageSigningEnabled=false `
129+ /p:GenerateAppInstallerFile=false
130+
131+ if ($LASTEXITCODE -ne 0) {
132+ Write-Error "MSIX build failed"
133+ exit 1
134+ }
135+
136+ - name : Verify MSIX build output
137+ if : env.BUILD_MSIX == 'true'
138+ shell : pwsh
139+ run : |
140+ $msixPath = "Package\AppPackages\GhostDraw.Package_${{ env.VERSION }}_Test\GhostDraw.Package_${{ env.VERSION }}_x64.msix"
141+
142+ if (Test-Path $msixPath) {
143+ $size = (Get-Item $msixPath).Length / 1MB
144+ Write-Host "✓ MSIX package built successfully" -ForegroundColor Green
145+ Write-Host " Path: $msixPath" -ForegroundColor Gray
146+ Write-Host " Size: $([math]::Round($size, 2)) MB" -ForegroundColor Gray
147+ } else {
148+ Write-Error "MSIX package not found at $msixPath"
149+ exit 1
150+ }
151+
152+ # ============================================================
153+ # End MSIX Build
154+ # ============================================================
155+
106156 - name : Create portable zip
107157 shell : pwsh
108158 run : |
@@ -119,6 +169,7 @@ jobs:
119169 name : |
120170 GhostDrawSetup-*
121171 GhostDraw-*-portable
172+ GhostDraw-*-MSIX
122173 failOnError : false
123174
124175 - name : Upload installer artifact
@@ -135,6 +186,14 @@ jobs:
135186 path : GhostDraw-${{ env.VERSION }}-portable.zip
136187 retention-days : 30
137188
189+ # - name: Upload MSIX artifact
190+ # if: env.BUILD_MSIX == 'true'
191+ # uses: actions/upload-artifact@v4
192+ # with:
193+ # name: GhostDraw-${{ env.VERSION }}-MSIX
194+ # path: Package/AppPackages/GhostDraw.Package_${{ env.VERSION }}_Test/*.msix
195+ # retention-days: 30
196+
138197 # Check if a PUBLISHED (non-draft) release exists for this version
139198 # If only a draft exists, we should update it with new assets
140199 - name : Check if published release exists
@@ -170,6 +229,25 @@ jobs:
170229 # Always exit successfully
171230 exit 0
172231
232+ - name : Prepare release files list
233+ if : github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_release.outputs.skip_release == 'false'
234+ id : release_files
235+ shell : pwsh
236+ run : |
237+ $files = @(
238+ "Installer/bin/x64/Release/GhostDrawSetup-${{ env.VERSION }}.msi",
239+ "GhostDraw-${{ env.VERSION }}-portable.zip"
240+ )
241+
242+ if ($env:BUILD_MSIX -eq 'true') {
243+ $files += "Package/AppPackages/GhostDraw.Package_${{ env.VERSION }}_Test/GhostDraw.Package_${{ env.VERSION }}_x64.msix"
244+ }
245+
246+ $filesList = $files -join "`n"
247+ "files<<EOF" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
248+ $filesList | Out-File -FilePath $env:GITHUB_OUTPUT -Append
249+ "EOF" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
250+
173251 - name : Create or update draft release
174252 if : github.event_name == 'push' && github.ref == 'refs/heads/main' && steps.check_release.outputs.skip_release == 'false'
175253 uses : softprops/action-gh-release@v2
@@ -179,15 +257,14 @@ jobs:
179257 draft : true
180258 prerelease : false
181259 generate_release_notes : true
182- files : |
183- Installer/bin/x64/Release/GhostDrawSetup-${{ env.VERSION }}.msi
184- GhostDraw-${{ env.VERSION }}-portable.zip
260+ files : ${{ steps.release_files.outputs.files }}
185261 body : |
186262 ## GhostDraw v${{ env.VERSION }}
187263
188264 ### Downloads
189- - **GhostDrawSetup-${{ env.VERSION }}.msi** - Windows installer
265+ - **GhostDrawSetup-${{ env.VERSION }}.msi** - Windows installer (recommended)
190266 - **GhostDraw-${{ env.VERSION }}-portable.zip** - Portable version (no installation required)
267+ ${{ env.BUILD_MSIX == 'true' && format('- **GhostDraw.Package_{0}_x64.msix** - Microsoft Store package (unsigned - for testing only)', env.VERSION) || '' }}
191268
192269 ### Installation
193270 1. Download the MSI installer or portable ZIP
0 commit comments