Skip to content

Commit 3e7230e

Browse files
committed
Update main_build-maui_release.yml
1 parent cd40909 commit 3e7230e

File tree

1 file changed

+62
-94
lines changed

1 file changed

+62
-94
lines changed

.github/workflows/main_build-maui_release.yml

Lines changed: 62 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -94,44 +94,21 @@ jobs:
9494
- name: Build WinUI win10-x64
9595
run: dotnet publish ${{env.CSPROJ_PATH}} -f "${{env.WINUI_TFM}}" -p:RuntimeIdentifierOverride="win10-x64" -p:PublishTrimmed=False -p:GenerateAppxPackageOnBuild=true -p:AppxPackageSigningEnabled=false -p:EnableMsixTooling=true --self-contained=true
9696

97-
# Compile and publish the WinUI ARM64 project for the Microsoft Store (no code signing for store builds, Microsoft signs it)
98-
- name: Build WinUI win10-arm64
99-
run: dotnet publish ${{env.CSPROJ_PATH}} -f "${{env.WINUI_TFM}}" -p:RuntimeIdentifierOverride="win10-arm64" -p:PublishTrimmed=False -p:GenerateAppxPackageOnBuild=true -p:AppxPackageSigningEnabled=false -p:EnableMsixTooling=true --self-contained=true
100-
10197
# Find the msix file
102-
- name: Generate msixbundle
103-
id: generate-msixbundle
98+
- name: Locate msix
99+
id: find-msix-file
104100
run: |
105-
# 1. Add MakeAppx to the PATH
106-
$sdkToolsPath = Join-Path -Path 'C:\Program Files (x86)\Windows Kits\10\bin' -ChildPath 10.0.22621.0 -AdditionalChildPath x86
107-
$env:Path += ";$sdkToolsPath"
108-
109-
# 2. Create the artifacts folder and copy msix files
110-
New-Item -Path . -Name ${{env.WINDOWS_ARTIFACTS_PATH}} -ItemType Directory
111-
112-
Copy-Item ${{github.workspace}}\src\MAUI\bin\Release\net9.0-windows10.0.22621.0\win10-x64\AppPackages\${{needs.shared-resources.outputs.app_version}}_Test\MauiDemo_${{needs.shared-resources.outputs.app_version}}.0_x64.msix -Destination ${{env.WINDOWS_ARTIFACTS_PATH}}
113-
114-
Copy-Item ${{github.workspace}}\src\MAUI\bin\Release\net9.0-windows10.0.22621.0\win10-arm64\AppPackages\${{needs.shared-resources.outputs.app_version}}_Test\MauiDemo_${{needs.shared-resources.outputs.app_version}}.0_arm64.msix -Destination ${{env.WINDOWS_ARTIFACTS_PATH}}
115-
116-
# 4. Change directory to the artifacts folder
117-
Set-Location ${{env.WINDOWS_ARTIFACTS_PATH}}
118-
119-
$bundleFilePath="MauiDemo_v${{needs.shared-resources.outputs.app_version}}_x64_arm64_MsftStoreOnly.msixbundle"
120-
121-
# 5. Create the msixbundle using all the msix files inside the artifacts folder
122-
MakeAppx.exe bundle /bv "${{needs.shared-resources.outputs.app_version}}" /d . /p $bundleFilePath
123-
124-
# 6. Export the bundle path
125-
echo "msixbundle_path=$bundleFilePath" >> $env:GITHUB_OUTPUT
101+
$msixPath = Get-ChildItem -Filter MauiDemo*.msix -Recurse | %{$_.FullName}
102+
echo "PACKAGE_PATH=$msixPath" >> $env:GITHUB_OUTPUT
126103
127-
# Attaching the msixbundle as an artifact
104+
# Attaching the asset to workflow run
128105
- name: Attach artifacts
129106
uses: actions/upload-artifact@v4
130107
with:
131-
name: "MauiDemo_v${{needs.shared-resources.outputs.app_version}}_x64_arm64_MsftStoreOnly.msixbundle"
132-
path: ${{steps.generate-msixbundle.outputs.msixbundle_path}}
108+
name: "MauiDemo_v${{needs.shared-resources.outputs.app_version}}_MsftStoreOnly.msix"
109+
path: ${{steps.find-msix-file.outputs.PACKAGE_PATH}}
133110
if-no-files-found: error
134-
retention-days: 10
111+
retention-days: 30
135112

136113

137114
# ************************************** #
@@ -144,7 +121,7 @@ jobs:
144121
if: ${{ needs.shared-resources.outputs.app_version != ''}}
145122
strategy:
146123
matrix:
147-
RID: [win10-arm64, win10-x64]
124+
RID: [win10-x64]
148125
steps:
149126
- name: Checkout
150127
uses: actions/checkout@v4
@@ -227,17 +204,6 @@ jobs:
227204
if-no-files-found: error
228205
retention-days: 30
229206

230-
- name: Attach asset to GitHub Release
231-
id: upload-release-asset
232-
uses: actions/upload-release-asset@v1
233-
env:
234-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
235-
with:
236-
upload_url: ${{needs.shared-resources.outputs.upload_url}}
237-
asset_path: ${{steps.find-msix-file.outputs.PACKAGE_PATH}}
238-
asset_name: "MauiDemo_v${{needs.shared-resources.outputs.app_version}}_${{matrix.RID}}.msix"
239-
asset_content_type: application/zip
240-
241207

242208
# ********************************* #
243209
# >>>>>>> MacCatalyst Build <<<<<<< #
@@ -454,54 +420,56 @@ jobs:
454420
# if-no-files-found: warn
455421
# retention-days: 10
456422

457-
458-
create_release:
459-
name: Create a new release
460-
if: ${{success()}}
461-
needs: [shared-resources, maui-macos, maui-windows-sideload, maui-windows-msstore] #, maui-ios, maui-android
462-
runs-on: ubuntu-latest
463-
defaults:
464-
run:
465-
shell: bash
466-
steps:
467-
- name: Download Artifacts
468-
uses: actions/download-artifact@v4
469-
with:
470-
pattern: MauiDemo*
471-
472-
- name: Confirm downloaded files
473-
run: ls -R
474-
475-
- name: Install zip tools
476-
run: |
477-
sudo apt-get update
478-
sudo apt-get install zip
479-
480-
- name: Archive each release asset
481-
run: |
482-
for file in *; do
483-
if [ -f "$file" ]; then
484-
echo "zipping up $file ..."
485-
zip -r "$file.zip" "$file"
486-
fi
487-
done
488-
489-
- name: Delete original files
490-
run: find . -type f -not -name '*.zip' -delete
491-
492-
- name: Confirm processed files
493-
run: ls
494-
495-
- name: Create list of zip files
496-
id: prepare-files-list
497-
run: |
498-
files=("*.zip")
499-
echo "release_files=$files" >> $env:GITHUB_OUTPUT
500-
501-
- name: Release
502-
uses: softprops/action-gh-release@v2
503-
with:
504-
name: "${{needs.shared-resources.outputs.app_version}}"
505-
tag_name: "${{needs.shared-resources.outputs.app_version}}"
506-
fail_on_unmatched_files: true
507-
files: ${steps.prepare-files-list.outputs.release_files}
423+
# ****************************** #
424+
# >>>>>>> GitHub Release <<<<<<< #
425+
# ****************************** #
426+
# create_release:
427+
# name: Create a new release
428+
# if: ${{success()}}
429+
# needs: [shared-resources, maui-macos, maui-windows-sideload, maui-windows-msstore] #, maui-ios, maui-android
430+
# runs-on: ubuntu-latest
431+
# defaults:
432+
# run:
433+
# shell: bash
434+
# steps:
435+
# - name: Download Artifacts
436+
# uses: actions/download-artifact@v4
437+
# with:
438+
# pattern: MauiDemo*
439+
440+
# - name: Confirm downloaded files
441+
# run: ls -R
442+
443+
# - name: Install zip tools
444+
# run: |
445+
# sudo apt-get update
446+
# sudo apt-get install zip
447+
448+
# - name: Archive each release asset
449+
# run: |
450+
# for file in *; do
451+
# if [ -f "$file" ]; then
452+
# echo "zipping up $file ..."
453+
# zip -r "$file.zip" "$file"
454+
# fi
455+
# done
456+
457+
# - name: Delete original files
458+
# run: find . -type f -not -name '*.zip' -delete
459+
460+
# - name: Confirm processed files
461+
# run: ls
462+
463+
# - name: Create list of zip files
464+
# id: prepare-files-list
465+
# run: |
466+
# files=("*.zip")
467+
# echo "release_files=$files" >> $env:GITHUB_OUTPUT
468+
469+
# - name: Release
470+
# uses: softprops/action-gh-release@v2
471+
# with:
472+
# name: "${{needs.shared-resources.outputs.app_version}}"
473+
# tag_name: "${{needs.shared-resources.outputs.app_version}}"
474+
# fail_on_unmatched_files: true
475+
# files: ${steps.prepare-files-list.outputs.release_files}

0 commit comments

Comments
 (0)