Codechange: [CI] Upload to the Windows Store automatically.

Microsoft expects a .msixbundle these days, which is effectively identical to .appxbundle, but needs a newer version of Windows 10, so bump our minimum version requirement too.
This commit is contained in:
Owen Rudge
2026-02-03 12:10:59 +00:00
parent 6090865874
commit 1fdcccbd49
5 changed files with 64 additions and 5 deletions
+3 -3
View File
@@ -124,7 +124,7 @@ jobs:
run: |
cd builds
REM We need to provide a signed .appx to the Windows Store, so generate a certificate with password 'password'
REM We need to provide a signed .msix to the Windows Store, so generate a certificate with password 'password'
call ..\os\windows\winstore\generate-key.bat "CN=78024DA8-4BE4-4C77-B12E-547BBF7359D2" password cert.pfx
- name: Generate assets
@@ -176,13 +176,13 @@ jobs:
REM Build and sign the package
makeappx build /v /f PackagingLayout.xml /op output\ /bv %OTTD_VERSION% /pv %OTTD_VERSION% /ca
SignTool sign /fd sha256 /a /f cert.pfx /p password "output\OpenTTD.appxbundle"
SignTool sign /fd sha256 /a /f cert.pfx /p password "output\OpenTTD.msixbundle"
REM Move resulting files to bundles folder
mkdir bundles
mkdir bundles\internal
move cert.pfx bundles\internal\openttd-${{ inputs.version }}-windows-store.pfx
move output\OpenTTD.appxbundle bundles\internal\openttd-${{ inputs.version }}-windows-store.appxbundle
move output\OpenTTD.msixbundle bundles\internal\openttd-${{ inputs.version }}-windows-store.msixbundle
- name: Store bundles
uses: actions/upload-artifact@v6
+15
View File
@@ -153,3 +153,18 @@ jobs:
with:
version: ${{ needs.source.outputs.version }}
upload-windows-store:
name: Upload (Windows Store)
needs:
- upload
# Only upload final release builds to Windows Store; "-beta" or "-RC" tags should be ignored
if: needs.source.outputs.is_tag == 'true' && !contains(needs.source.outputs.version, '-')
uses: ./.github/workflows/upload-windows-store.yml
secrets: inherit
with:
version: ${{ needs.source.outputs.version }}
trigger_type: ${{ needs.source.outputs.trigger_type }}
@@ -0,0 +1,44 @@
name: Upload (Windows Store)
on:
workflow_call:
inputs:
version:
required: true
type: string
trigger_type:
required: true
type: string
jobs:
upload:
name: Upload (Windows Store)
runs-on: windows-latest
steps:
- name: Download bundle (Windows Store)
uses: actions/download-artifact@v6
with:
name: openttd-windows-store
path: openttd-windows-store
- name: Configure Microsoft Store CLI
uses: microsoft/microsoft-store-apppublisher@v1.1
- name: Reconfigure store credentials
run: msstore reconfigure `
--tenantId ${{ secrets.AZURE_TENANT_ID }} `
--sellerId ${{ secrets.WINSTORE_SELLER_ID }} `
--clientId ${{ secrets.AZURE_WINSTORE_APPLICATION_CLIENT_ID }} `
--clientSecret ${{ secrets.AZURE_WINSTORE_APPLICATION_SECRET }}
- name: Publish msix package
shell: pwsh
run: |
$bundle = Get-ChildItem openttd-windows-store/internal/openttd-*.msixbundle | Select-Object -First 1
if (-not $bundle) {
throw "No msixbundle found"
}
msstore publish $bundle.FullName -id 9NCJG5RVRR1C -v
@@ -63,6 +63,6 @@
<Resource Language="cy-gb" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17134.0" MaxVersionTested="10.0.18363.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17701.0" MaxVersionTested="10.0.18363.0" />
</Dependencies>
</Package>
@@ -7,7 +7,7 @@
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17134.0" MaxVersionTested="10.0.18363.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17701.0" MaxVersionTested="10.0.18363.0" />
</Dependencies>
<Resources>
<Resource Language="en-gb" />