Skip to content

Commit dfe3291

Browse files
committed
ci: automate release workflow and version detection
- Rename manual_release.yml to release.yml and add a push trigger for version tags (v*). - Enhance version detection logic to prioritize Git tags, manual inputs, or extraction from CHANGELOG.md. - Implement version normalization to ensure a consistent 'v' prefix. - Update CHANGELOG.md with release notes for version 4.0.1.
1 parent e3f0506 commit dfe3291

File tree

2 files changed

+67
-22
lines changed

2 files changed

+67
-22
lines changed
Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
name: Manual Release Build
1+
name: Release Build
22

33
on:
4+
push:
5+
tags:
6+
- 'v*'
47
workflow_dispatch:
58
inputs:
69
version:
7-
description: 'Version Tag (Leave empty to use latest Git tag)'
10+
description: 'Version Tag (Leave empty to use CHANGELOG.md latest)'
811
required: false
9-
default: '' # Leave blank to default to git tag
12+
default: '' # Leave blank to use CHANGELOG.md
1013
release_notes:
1114
description: 'Short Summary (Edit the full release page later for long text)'
1215
required: false
@@ -30,29 +33,54 @@ jobs:
3033
id: get_version
3134
shell: pwsh
3235
run: |
36+
# Priority:
37+
# 1. Git Tag (if triggered by tag push)
38+
# 2. Workflow Input (if provided manually)
39+
# 3. CHANGELOG.md Latest Version (if manually triggered empty)
40+
41+
$refType = "${{ github.ref_type }}"
42+
$refName = "${{ github.ref_name }}"
3343
$inputVer = "${{ inputs.version }}"
34-
35-
if ([string]::IsNullOrWhiteSpace($inputVer)) {
36-
try {
37-
# Get the latest tag from git (e.g., v2.8.0)
38-
$gitTag = git describe --tags --abbrev=0
39-
Write-Host "No input provided. Detected latest git tag: $gitTag"
40-
$finalVersion = $gitTag
41-
} catch {
42-
Write-Error "No input provided and no Git tags found in repository!"
43-
exit 1
44-
}
45-
} else {
46-
$inputVer = $inputVer.Trim()
47-
if (-not ($inputVer.ToLower().StartsWith("v"))) {
48-
$finalVersion = "v$inputVer"
49-
Write-Host "Added 'v' prefix to input: $finalVersion"
50-
} else {
44+
$changelogPath = "CHANGELOG.md"
45+
46+
if ($refType -eq 'tag') {
47+
# 1. Triggered by Tag
48+
Write-Host "Triggered by Git Tag: $refName"
49+
$finalVersion = $refName
50+
} elseif (-not [string]::IsNullOrWhiteSpace($inputVer)) {
51+
# 2. Manual Trigger with Input
52+
Write-Host "Triggered manually with input: $inputVer"
5153
$finalVersion = $inputVer
52-
Write-Host "Using user input version: $finalVersion"
53-
}
54+
} else {
55+
# 3. Manual Trigger Empty -> Read CHANGELOG.md
56+
Write-Host "Triggered manually (empty input). Reading latest version from $changelogPath..."
57+
58+
if (Test-Path $changelogPath) {
59+
$content = Get-Content $changelogPath -Raw
60+
# Regex to find the first version header like ## [4.0.1] or ## [v4.0.1]
61+
# We only care about the first match (latest version)
62+
if ($content -match '## \[(v?[\d\.]+)\]') {
63+
$detectedVersion = $Matches[1]
64+
Write-Host "Found latest version in CHANGELOG: $detectedVersion"
65+
$finalVersion = $detectedVersion
66+
} else {
67+
Write-Error "Could not find any version header (## [x.x.x]) in $changelogPath!"
68+
exit 1
69+
}
70+
} else {
71+
Write-Error "$changelogPath not found!"
72+
exit 1
73+
}
74+
}
75+
76+
# Normalize to ensure 'v' prefix for Release Tag/Title consistency
77+
$finalVersion = $finalVersion.Trim()
78+
if (-not $finalVersion.ToLower().StartsWith("v")) {
79+
$finalVersion = "v$finalVersion"
5480
}
5581
82+
Write-Host "Final Determined Version: $finalVersion"
83+
5684
# Save to GITHUB_ENV so all other steps use this variable
5785
echo "RELEASE_VERSION=$finalVersion" >> $env:GITHUB_ENV
5886

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## [4.0.1] - 2026-02-08
4+
5+
### New Features/Changes
6+
7+
- **Terminal**: Added a new keyboard shortcut `[A]` to directly open the Audio Analyzer from the console main menu.
8+
- **System Tray**: Direct file editing options ("Edit config.ini", "Edit prompts.json") in the tray menu are now conditionally visible only when the application is started with the `--show-console` flag.
9+
10+
### Improvements
11+
12+
- **GUI**: Fix scrolling of Settings and Prompt Editor windows in Tkinter fallback mode.
13+
- **UI/UX**: Adjusted widget widths and layout in the Settings window for better visual consistency, specifically targeting host/port fields, provider selection, and model dropdowns.
14+
- **Terminal**: Reorganized the main command box to prioritize the Audio Tool shortcut rather than Endpoint.
15+
16+
### Internal
17+
18+
- **Request Pipeline**: Simplified request origin tracking by consolidating multiple specific endpoint origins into a single `ENDPOINT` type.
19+
320
## [4.0.0] - 2026-02-08
421

522
### New Features

0 commit comments

Comments
 (0)