Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# An administrator must require code-owner approval and grant the team explicit write access.
/.github/ @openclaw/release-managers-openclaw
/scripts/ @openclaw/release-managers-openclaw
/release-policy.json @openclaw/release-managers-openclaw
/Directory.Build.* @openclaw/release-managers-openclaw
/Directory.Packages.props @openclaw/release-managers-openclaw
/global.json @openclaw/release-managers-openclaw
/src/OpenClaw.Launcher/Package.appxmanifest @openclaw/release-managers-openclaw
5 changes: 1 addition & 4 deletions .github/workflows/gateway-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,7 @@ jobs:
- name: Test Microsoft Store submission
shell: pwsh
run: |
./scripts/Test-Submit-MicrosoftStore.Tests.ps1
./scripts/Test-StoreFlightSubmission.Tests.ps1
./scripts/Test-StoreSubmissionSource.Tests.ps1
./scripts/Test-StoreSubmissionWorkflow.Tests.ps1
./scripts/Test-Request-MicrosoftStorePublish.Tests.ps1

- name: Test signing workflow configuration
shell: pwsh
Expand Down
222 changes: 30 additions & 192 deletions .github/workflows/submit-microsoft-store.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Submit Microsoft Store
name: Request Microsoft Store publication

on:
workflow_dispatch:
Expand All @@ -8,210 +8,48 @@ on:
type: string
required: true
channel:
description: Store destination (must match the release type)
description: Store destination (must match the qualified release type)
type: choice
options: [production, development]
default: production
required: true
workflow_run:
workflows: [Build OpenClaw Gateway MSIX]
types: [completed]

permissions:
contents: read
actions: read

concurrency:
group: microsoft-store-submission
group: microsoft-store-request
cancel-in-progress: false

jobs:
source:
request:
if: >-
github.repository == 'openclaw/openclaw-windows-packaging' &&
github.ref == 'refs/heads/main' &&
(github.event_name == 'workflow_dispatch' ||
((vars.MSSTORE_ENABLED == 'true' || vars.MSSTORE_DEVELOPMENT_ENABLED == 'true') && github.event.workflow_run.conclusion == 'success'))
github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
outputs:
eligible: ${{ steps.source.outputs.eligible }}
channel: ${{ steps.source.outputs.channel }}
artifact_id: ${{ steps.source.outputs.artifact_id }}
bundle_name: ${{ steps.source.outputs.bundle_name }}
bundle_sha256: ${{ steps.source.outputs.bundle_sha256 }}
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Resolve authorized release artifact
id: source
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
REQUESTED_CHANNEL: ${{ inputs.channel || 'auto' }}
PRODUCTION_ENABLED: ${{ vars.MSSTORE_ENABLED }}
DEVELOPMENT_ENABLED: ${{ vars.MSSTORE_DEVELOPMENT_ENABLED }}
SOURCE_RUN_ID: ${{ inputs.run_id || github.event.workflow_run.id }}
run: |
$source = ./scripts/Get-StoreSubmissionSource.ps1 -RunId $env:SOURCE_RUN_ID -Channel $env:REQUESTED_CHANNEL
if ($null -eq $source) {
if ($env:GITHUB_EVENT_NAME -eq 'workflow_dispatch') { throw 'The selected run is not an eligible Store release.' }
'eligible=false' >> $env:GITHUB_OUTPUT
exit 0
}
$enabled = if ($source.channel -ceq 'development') { $env:DEVELOPMENT_ENABLED } else { $env:PRODUCTION_ENABLED }
if ($env:GITHUB_EVENT_NAME -ne 'workflow_dispatch' -and $enabled -cne 'true') {
'eligible=false' >> $env:GITHUB_OUTPUT
exit 0
}
"channel=$($source.channel)" >> $env:GITHUB_OUTPUT
'eligible=true' >> $env:GITHUB_OUTPUT
"artifact_id=$($source.artifactId)" >> $env:GITHUB_OUTPUT
"bundle_name=$($source.bundleName)" >> $env:GITHUB_OUTPUT
"bundle_sha256=$($source.bundleSha256)" >> $env:GITHUB_OUTPUT
"Store source: run $env:SOURCE_RUN_ID, artifact $($source.artifactId), bundle $($source.bundleName)" >> $env:GITHUB_STEP_SUMMARY

submit-microsoft-store:
needs: source
if: needs.source.outputs.eligible == 'true'
runs-on: ubuntu-latest
environment: microsoft-store
timeout-minutes: 60
permissions:
contents: read
actions: read
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Download verified Store bundle
uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.source.outputs.artifact_id }}
run-id: ${{ inputs.run_id || github.event.workflow_run.id }}
github-token: ${{ github.token }}
merge-multiple: true
path: store

- name: Validate Microsoft Store environment
shell: pwsh
env:
MSSTORE_TENANT_ID: ${{ vars.MSSTORE_TENANT_ID }}
MSSTORE_CLIENT_ID: ${{ vars.MSSTORE_CLIENT_ID }}
MSSTORE_APPLICATION_ID: ${{ vars.MSSTORE_APPLICATION_ID }}
STORE_CHANNEL: ${{ needs.source.outputs.channel }}
MSSTORE_DEVELOPMENT_FLIGHT_ID: ${{ vars.MSSTORE_DEVELOPMENT_FLIGHT_ID }}
run: |
if ($env:STORE_CHANNEL -ceq 'development') {
$flightId = [guid]::Empty
if (-not [guid]::TryParse($env:MSSTORE_DEVELOPMENT_FLIGHT_ID, [ref]$flightId)) {
throw 'The microsoft-store environment is missing a valid MSSTORE_DEVELOPMENT_FLIGHT_ID.'
}
}
foreach ($name in @(
'MSSTORE_TENANT_ID'
'MSSTORE_CLIENT_ID'
'MSSTORE_APPLICATION_ID'
)) {
if ([string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable($name))) {
throw "The microsoft-store environment is missing $name."
}
}
foreach ($name in @('MSSTORE_TENANT_ID', 'MSSTORE_CLIENT_ID')) {
$value = [Environment]::GetEnvironmentVariable($name)
$parsed = [guid]::Empty
if (-not [guid]::TryParse($value, [ref]$parsed)) {
throw "$name must be a GUID."
}
}
- name: Request short-lived Microsoft Store assertion
id: oidc
shell: pwsh
run: |
$policy = Get-Content -LiteralPath .\store-submission.json -Raw |
ConvertFrom-Json
$requestUrl = $env:ACTIONS_ID_TOKEN_REQUEST_URL
$requestToken = $env:ACTIONS_ID_TOKEN_REQUEST_TOKEN
if ([string]::IsNullOrWhiteSpace($requestUrl) -or
[string]::IsNullOrWhiteSpace($requestToken)) {
throw 'GitHub did not provide an OIDC token endpoint.'
}
$oidcRequestUri = .\scripts\New-GitHubOidcRequestUri.ps1 `
-RequestUri $requestUrl `
-Audience ([string]$policy.oidcAudience)
$response = Invoke-RestMethod `
-Headers @{ Authorization = "Bearer $requestToken" } `
-Uri $oidcRequestUri
$assertion = [string]$response.value
if ([string]::IsNullOrWhiteSpace($assertion)) {
throw 'GitHub returned an empty OIDC assertion.'
}
Write-Output "::add-mask::$assertion"
$assertionPath = Join-Path $env:RUNNER_TEMP 'msstore-assertion.jwt'
[IO.File]::WriteAllText($assertionPath, $assertion)
& chmod 600 $assertionPath
if ($LASTEXITCODE -ne 0) {
throw 'Unable to restrict the OIDC assertion file permissions.'
}
"assertion_path=$assertionPath" >> $env:GITHUB_OUTPUT

- name: Submit bundle and commit Store update
shell: pwsh
env:
MSSTORE_TENANT_ID: ${{ vars.MSSTORE_TENANT_ID }}
MSSTORE_CLIENT_ID: ${{ vars.MSSTORE_CLIENT_ID }}
MSSTORE_APPLICATION_ID: ${{ vars.MSSTORE_APPLICATION_ID }}
STORE_CHANNEL: ${{ needs.source.outputs.channel }}
MSSTORE_DEVELOPMENT_FLIGHT_ID: ${{ vars.MSSTORE_DEVELOPMENT_FLIGHT_ID }}
MSSTORE_ASSERTION_FILE: ${{ steps.oidc.outputs.assertion_path }}
EXPECTED_BUNDLE_NAME: ${{ needs.source.outputs.bundle_name }}
EXPECTED_BUNDLE_SHA256: ${{ needs.source.outputs.bundle_sha256 }}
run: |
$identityDocument = Get-Content ./release-policy.json -Raw | ConvertFrom-Json
$identityName = [string]$identityDocument.packageIdentityName
$publisher = [string]$identityDocument.publisher
$bundle = @(Get-ChildItem ./store -File -Filter *.msixbundle)
if ($bundle.Count -ne 1 -or $bundle[0].Name -cne $env:EXPECTED_BUNDLE_NAME) {
throw 'Downloaded Store artifact must contain the selected bundle.'
}
if ($env:EXPECTED_BUNDLE_SHA256 -cnotmatch '^[0-9a-f]{64}$' -or
(Get-FileHash $bundle[0].FullName -Algorithm SHA256).Hash.ToLowerInvariant() -cne $env:EXPECTED_BUNDLE_SHA256) {
throw 'Store bundle does not match the release witness.'
}
$destination = @{ Channel = $env:STORE_CHANNEL }
if ($env:STORE_CHANNEL -ceq 'development') { $destination.FlightId = $env:MSSTORE_DEVELOPMENT_FLIGHT_ID }
.\scripts\Submit-MicrosoftStore.ps1 @destination `
-BundlePath $bundle[0].FullName `
-ApplicationId $env:MSSTORE_APPLICATION_ID `
-PackageIdentityName $identityName -Publisher $publisher `
-TenantId $env:MSSTORE_TENANT_ID `
-ClientId $env:MSSTORE_CLIENT_ID `
-ClientAssertionFile $env:MSSTORE_ASSERTION_FILE `
-PolicyPath .\store-submission.json `
-EvidencePath .\evidence\store-submission.json

- name: Upload Store submission evidence
if: ${{ always() }}
continue-on-error: true
uses: actions/upload-artifact@v7
with:
name: openclaw-gateway-store-submission-evidence
path: evidence/store-submission.json
if-no-files-found: error
retention-days: 90

- name: Remove short-lived assertion
if: ${{ always() }}
shell: pwsh
env:
MSSTORE_ASSERTION_FILE: ${{ steps.oidc.outputs.assertion_path }}
run: |
if (-not [string]::IsNullOrWhiteSpace($env:MSSTORE_ASSERTION_FILE)) {
Remove-Item `
-LiteralPath $env:MSSTORE_ASSERTION_FILE `
-Force `
-ErrorAction SilentlyContinue
}
- name: Check out request adapter
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Mint request-only release token
id: release-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510
with:
app-id: 2729701
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: openclaw
repositories: releases
permission-actions: write

- name: Request release-manager-approved Store publication
shell: pwsh
env:
GH_TOKEN: ${{ steps.release-token.outputs.token }}
SOURCE_RUN_ID: ${{ inputs.run_id }}
STORE_CHANNEL: ${{ inputs.channel }}
run: |
$request = ./scripts/Request-MicrosoftStorePublish.ps1 -RunId $env:SOURCE_RUN_ID -Channel $env:STORE_CHANNEL
"Store $($request.channel) publication requested for Gateway source run $($request.sourceRunId)." >> $env:GITHUB_STEP_SUMMARY
'Follow [Windows Store publication](https://github.com/openclaw/releases/actions/workflows/windows-store-publish.yml) for release-manager approval and the Store receipt. This request is not Store acceptance.' >> $env:GITHUB_STEP_SUMMARY
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ or package version logic:
.\scripts\Test-WorkflowSigningConfiguration.ps1
.\scripts\Test-MSIXUpgradeMatrix.Tests.ps1
.\scripts\Test-WorkflowPackageVersion.Tests.ps1
.\scripts\Test-Submit-MicrosoftStore.Tests.ps1
.\scripts\Test-Request-MicrosoftStorePublish.Tests.ps1
.\scripts\Test-GitHooks.Tests.ps1
```

Expand Down Expand Up @@ -455,6 +455,13 @@ Three project skills in `.github\skills\` support this work:

## Pull requests

Release automation, its dependencies, and package identity inputs are owned by
`@openclaw/release-managers-openclaw` in `.github\CODEOWNERS`. Administrators must
grant the team explicit write access and enforce code-owner approval on `main`;
the file alone does not protect changes. Store publication additionally needs the
central environment and exclusive federation described in the
[Store cutover guide](docs/microsoft-store.md#activate-the-centralized-publisher).

Use the pull request template. Title the PR
`type: user-facing description`, where `type` is one of `feat`, `fix`,
`improve`, `refactor`, `docs`, or `chore`. Describe the outcome rather than the
Expand Down
2 changes: 2 additions & 0 deletions docs/local-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ Run PowerShell policy suites by owning surface rather than indiscriminately:
`Test-WorkflowSigningConfiguration.ps1` for source capture, retry context,
cache routing, and selected-build outcomes,
`Test-MSIXUpgradeMatrix.Tests.ps1` for parallel upgrade scenario selection,
`Test-Request-MicrosoftStorePublish.Tests.ps1` for the request-only central Store
handoff (synthetic command fixtures, never a live dispatch),
`Test-Deploy-LocalPackage.Tests.ps1` for the loose-registration flow, and
`Test-Sign-TestMSIX.Tests.ps1` for test signing. The Node input suite requires
Node.js and npm; its local fixture exercises the approved OpenClaw install hook,
Expand Down
Loading
Loading