Skip to content
Merged
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
13 changes: 10 additions & 3 deletions .github/workflows/release-msix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- "v[0-9]*"
# Dry run: builds, signs and verifies the bundle and uploads the artifact, but publishes nothing.
workflow_dispatch:

permissions:
contents: write
Expand Down Expand Up @@ -52,8 +54,6 @@ jobs:

- name: Validate release version
run: |
$tagVersion = "${{ github.ref_name }}" -replace '^v', ''

[xml]$project = Get-Content -LiteralPath $env:PROJECT_PATH -Raw
$versionGroup = @($project.Project.PropertyGroup | Where-Object { $_.Version } | Select-Object -First 1)
if (-not $versionGroup) {
Expand All @@ -64,6 +64,9 @@ jobs:
$assemblyVersion = [string]$versionGroup.AssemblyVersion
$fileVersion = [string]$versionGroup.FileVersion

# Dry runs (workflow_dispatch) have no tag; check the files against each other only.
$tagVersion = if ('${{ github.ref_type }}' -eq 'tag') { "${{ github.ref_name }}" -replace '^v', '' } else { $projectVersion }

$manifestPath = Join-Path (Split-Path -Parent $env:PROJECT_PATH) 'Package.appxmanifest'
[xml]$manifest = Get-Content -LiteralPath $manifestPath -Raw
$manifestVersion = [string]$manifest.Package.Identity.Version
Expand Down Expand Up @@ -181,6 +184,9 @@ jobs:

- name: Verify MSIX bundle
run: |
# The signing cert is self-signed, so a clean runner only accepts it once trusted.
Import-Certificate -FilePath $env:CER_PATH -CertStoreLocation Cert:\LocalMachine\TrustedPeople | Out-Null

& $env:SIGNTOOL verify /pa /v ${{ steps.bundle.outputs.path }}

if ($LASTEXITCODE -ne 0) {
Expand All @@ -197,6 +203,7 @@ jobs:
if-no-files-found: error

- name: Create or update GitHub Release
if: github.ref_type == 'tag'
env:
GH_TOKEN: ${{ github.token }}
run: |
Expand All @@ -219,7 +226,7 @@ jobs:
store-publish:
# Opt-in: set repo variable STORE_PUBLISH=true after adding the Partner Center secrets.
# Put required reviewers on the "microsoft-store" environment to gate each submission.
if: vars.STORE_PUBLISH == 'true'
if: github.ref_type == 'tag' && vars.STORE_PUBLISH == 'true'
needs: build-sign-release
runs-on: windows-latest
timeout-minutes: 30
Expand Down
Loading