From a768d480b81fdc98ffbacacd09f130e9608ea0de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 30 Jul 2026 11:29:15 +0200 Subject: [PATCH] Carry the MSI architecture into the winget manifest Parse it from the asset name instead of defaulting to x64, and fail on a multi-arch release rather than validating one at random. --- .github/workflows/package_winget.yml | 14 ++++++++------ release/.gitignore | 5 ----- 2 files changed, 8 insertions(+), 11 deletions(-) delete mode 100644 release/.gitignore diff --git a/.github/workflows/package_winget.yml b/.github/workflows/package_winget.yml index 61790b647d..c8e5401941 100644 --- a/.github/workflows/package_winget.yml +++ b/.github/workflows/package_winget.yml @@ -23,20 +23,22 @@ jobs: if (-not $tag) { throw 'No releases found.' } New-Item -ItemType Directory -Force -Path release/download | Out-Null gh release download $tag --pattern '*.msi' --dir release/download - $msi = Get-ChildItem release/download/*.msi | Select-Object -First 1 - if (-not $msi) { throw "Release $tag carries no MSI asset." } - $version = [regex]::Match($msi.Name, '^meshtasticd-([0-9][0-9A-Za-z.\-]*)-(?:x64|arm64)\.msi$').Groups[1].Value - if (-not $version) { throw "Cannot parse a version out of $($msi.Name)." } - "tag=$tag", "version=$version", "msi=$($msi.FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append + $msis = @(Get-ChildItem release/download/*.msi) + if ($msis.Count -eq 0) { throw "Release $tag carries no MSI asset." } + if ($msis.Count -gt 1) { throw "Release $tag carries $($msis.Count) MSIs; this validates one architecture." } + $parsed = [regex]::Match($msis[0].Name, '^meshtasticd-([0-9][0-9A-Za-z.\-]*)-(x64|arm64)\.msi$') + if (-not $parsed.Success) { throw "Cannot parse version and architecture out of $($msis[0].Name)." } + "tag=$tag", "version=$($parsed.Groups[1].Value)", "arch=$($parsed.Groups[2].Value)", "msi=$($msis[0].FullName)" | Out-File -FilePath $env:GITHUB_OUTPUT -Append env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Generate manifests for the published MSI shell: pwsh - run: ./bin/build-winget-package.ps1 -MsiPath $env:MSI_PATH -Version $env:PKG_VERSION -ReleaseTag $env:RELEASE_TAG -Validate + run: ./bin/build-winget-package.ps1 -MsiPath $env:MSI_PATH -Version $env:PKG_VERSION -Architecture $env:PKG_ARCH -ReleaseTag $env:RELEASE_TAG -Validate env: MSI_PATH: ${{ steps.release.outputs.msi }} PKG_VERSION: ${{ steps.release.outputs.version }} + PKG_ARCH: ${{ steps.release.outputs.arch }} RELEASE_TAG: ${{ steps.release.outputs.tag }} - name: Verify the manifest URL resolves to the published asset diff --git a/release/.gitignore b/release/.gitignore deleted file mode 100644 index 82d2caa701..0000000000 --- a/release/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.elf -*.bin -*.map -*.zip -*.uf2