Better changelog handling for beta release workflow.
This commit is contained in:
@@ -3,10 +3,6 @@ name: Manual Beta Release
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
release_notes:
|
|
||||||
description: Markdown release notes for this beta release
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
release_title:
|
release_title:
|
||||||
description: Optional GitHub release title override
|
description: Optional GitHub release title override
|
||||||
required: false
|
required: false
|
||||||
@@ -23,20 +19,21 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
PROJECT_PATH: Wino.Mail.WinUI/Wino.Mail.WinUI.csproj
|
PROJECT_PATH: Wino.Mail.WinUI/Wino.Mail.WinUI.csproj
|
||||||
MANIFEST_PATH: Wino.Mail.WinUI/Package.appxmanifest
|
MANIFEST_PATH: Wino.Mail.WinUI/Package.appxmanifest
|
||||||
|
CHANGELOG_PATH: CHANGELOG.md
|
||||||
PACKAGE_OUTPUT_DIR: ${{ github.workspace }}\artifacts\package
|
PACKAGE_OUTPUT_DIR: ${{ github.workspace }}\artifacts\package
|
||||||
RELEASE_OUTPUT_DIR: ${{ github.workspace }}\artifacts\release
|
RELEASE_OUTPUT_DIR: ${{ github.workspace }}\artifacts\release
|
||||||
CERTIFICATE_PFX_PATH: ${{ github.workspace }}\artifacts\signing\beta-signing-cert.pfx
|
CERTIFICATE_PFX_PATH: ${{ github.workspace }}\artifacts\signing\beta-signing-cert.pfx
|
||||||
CERTIFICATE_CER_PATH: ${{ github.workspace }}\artifacts\release\Wino-Mail-Beta.cer
|
CERTIFICATE_CER_PATH: ${{ github.workspace }}\artifacts\release\Wino-Mail-Beta.cer
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout main branch
|
- name: Checkout selected branch
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: main
|
ref: ${{ github.ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Fetch tags from origin
|
- name: Fetch tags from origin
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: git fetch origin --force --tags refs/heads/main:refs/remotes/origin/main
|
run: git fetch origin --force --tags
|
||||||
|
|
||||||
- name: Validate release secrets
|
- name: Validate release secrets
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
@@ -64,7 +61,6 @@ jobs:
|
|||||||
id: metadata
|
id: metadata
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
RELEASE_NOTES_INPUT: ${{ github.event.inputs.release_notes }}
|
|
||||||
RELEASE_TITLE_INPUT: ${{ github.event.inputs.release_title }}
|
RELEASE_TITLE_INPUT: ${{ github.event.inputs.release_title }}
|
||||||
run: |
|
run: |
|
||||||
$manifestPath = Join-Path $env:GITHUB_WORKSPACE $env:MANIFEST_PATH
|
$manifestPath = Join-Path $env:GITHUB_WORKSPACE $env:MANIFEST_PATH
|
||||||
@@ -72,6 +68,11 @@ jobs:
|
|||||||
throw "Package manifest not found: $manifestPath"
|
throw "Package manifest not found: $manifestPath"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$changelogPath = Join-Path $env:GITHUB_WORKSPACE $env:CHANGELOG_PATH
|
||||||
|
if (-not (Test-Path $changelogPath)) {
|
||||||
|
throw "Release notes file not found: $changelogPath"
|
||||||
|
}
|
||||||
|
|
||||||
[xml]$manifest = Get-Content -LiteralPath $manifestPath
|
[xml]$manifest = Get-Content -LiteralPath $manifestPath
|
||||||
$identityNode = $manifest.Package.Identity
|
$identityNode = $manifest.Package.Identity
|
||||||
if (-not $identityNode) {
|
if (-not $identityNode) {
|
||||||
@@ -102,7 +103,7 @@ jobs:
|
|||||||
|
|
||||||
$headSha = (git rev-parse HEAD).Trim()
|
$headSha = (git rev-parse HEAD).Trim()
|
||||||
if ([string]::IsNullOrWhiteSpace($headSha)) {
|
if ([string]::IsNullOrWhiteSpace($headSha)) {
|
||||||
throw "Failed to resolve the checked out main commit SHA."
|
throw "Failed to resolve the checked out commit SHA."
|
||||||
}
|
}
|
||||||
|
|
||||||
$previousReleaseTag = git tag --sort=-creatordate --list 'v*.*.*.*' | Select-Object -First 1
|
$previousReleaseTag = git tag --sort=-creatordate --list 'v*.*.*.*' | Select-Object -First 1
|
||||||
@@ -115,7 +116,12 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
$buildDateUtc = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd HH:mm 'UTC'")
|
$buildDateUtc = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd HH:mm 'UTC'")
|
||||||
$notesInput = $env:RELEASE_NOTES_INPUT.Trim()
|
$notesInput = Get-Content -LiteralPath $changelogPath -Raw
|
||||||
|
if ([string]::IsNullOrWhiteSpace($notesInput)) {
|
||||||
|
throw "Release notes file is empty: $changelogPath"
|
||||||
|
}
|
||||||
|
|
||||||
|
$notesInput = $notesInput.Trim()
|
||||||
$metadataSection = @"
|
$metadataSection = @"
|
||||||
## Build metadata
|
## Build metadata
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user