diff --git a/.github/WORKFLOWS_GUIDE.md b/.github/WORKFLOWS_GUIDE.md index f501a98..04a61d0 100644 --- a/.github/WORKFLOWS_GUIDE.md +++ b/.github/WORKFLOWS_GUIDE.md @@ -36,26 +36,24 @@ QODANA_ENDPOINT=https://qodana.cloud ``` ### 3. Release & Publish (`release.yml`) -**Trigger:** Push git tags (v1.0.0, release-1.0.0), or manual workflow dispatch +**Trigger:** Push git tags (`v*`, e.g. `v1.0.0`), or manual workflow dispatch **What it does:** -- Builds for **Windows** (x64, x86) - self-contained executables -- Builds for **Linux** (x64) - tar.gz packages -- Builds for **macOS** (x64, arm64) - universal support +- Builds **Windows** installers (x64, x86) via Inno Setup +- Builds **Linux** packages (x64) as `.deb` +- Builds **macOS** packages (x64, arm64) as `.dmg` - Publishes optimized release builds for all platforms -- Generates GitHub Release with all platform artifacts +- Generates GitHub Release with installer/package assets - Supports pre-release versions **Supported Platforms:** | Platform | Architectures | Output Format | Status | |----------|---------------|---------------|--------| -| Windows | x64, x86 | .zip | ✅ Full support | -| Linux | x64 | .tar.gz | ✅ Full support | -| macOS | x64, arm64 (Apple Silicon) | .tar.gz | ✅ Full support | +| Windows | x64, x86 | .exe (installer) | ✅ Full support | +| Linux | x64 | .deb | ✅ Full support | +| macOS | x64, arm64 (Apple Silicon) | .dmg | ✅ Full support | -**Build Scripts:** -- Windows: Uses PowerShell (`LanMountainDesktop\scripts\package.ps1`) -- Linux/macOS: Uses Bash (`scripts/build.sh`) +> Note: GitHub Actions artifacts are downloaded as zip containers. The actual packaged files inside are `.exe`, `.deb`, and `.dmg`. **Usage:** @@ -66,13 +64,9 @@ git push origin v1.0.0 # Automatically triggers Windows + Linux + macOS builds ``` -*Manual trigger with selective platforms:* +*Manual trigger:* Go to GitHub > Actions > Release & Publish > Run workflow -- Specify version: `1.0.0` -- Toggle build targets as needed: - - ✅ Build Windows (x64/x86) - - ✅ Build Linux (x64) - - ✅ Build macOS (x64/arm64) +- Specify release tag: `v1.0.0` (or `1.0.0`, workflow will normalize to `v1.0.0`) - Check pre-release option if needed ### 4. Issue Management (`issue-management.yml`) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10d96cc..bc34717 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,8 @@ on: push: + tags-ignore: + - '*' pull_request: workflow_dispatch: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e6b45d..4fc4a7e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,19 +26,30 @@ jobs: outputs: version: ${{ steps.version.outputs.version }} tag: ${{ steps.version.outputs.tag }} + checkout_ref: ${{ steps.version.outputs.checkout_ref }} steps: - name: Get release info id: version run: | if [[ "${{ github.event_name }}" == "push" ]]; then - TAG=${GITHUB_REF#refs/tags/} + TAG="${GITHUB_REF#refs/tags/}" + CHECKOUT_REF="${GITHUB_REF}" else - TAG=${{ github.event.inputs.tag }} + RAW_TAG="${{ github.event.inputs.tag }}" + if [[ "${RAW_TAG}" == refs/tags/* ]]; then + TAG="${RAW_TAG#refs/tags/}" + elif [[ "${RAW_TAG}" == v* ]]; then + TAG="${RAW_TAG}" + else + TAG="v${RAW_TAG}" + fi + CHECKOUT_REF="${GITHUB_SHA}" fi - VERSION=${TAG#v} + VERSION="${TAG#v}" echo "tag=${TAG}" >> $GITHUB_OUTPUT echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "checkout_ref=${CHECKOUT_REF}" >> $GITHUB_OUTPUT build-windows: needs: prepare @@ -54,7 +65,7 @@ jobs: with: fetch-depth: 0 submodules: recursive - ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} + ref: ${{ needs.prepare.outputs.checkout_ref }} - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -141,20 +152,26 @@ jobs: # Build installer with iscc.exe Write-Host "Building installer for Windows $arch with version $version..." - $compileCmd = @( - "`"$isccPath`"", + $publishDir = (Resolve-Path $publishDir).Path + $outputDir = (Resolve-Path $outputDir).Path + $installerScript = (Resolve-Path $installerScript).Path + + $compileArgs = @( "/DMyAppVersion=$version", - "/DPublishDir=..\$publishDir", - "/DMyOutputDir=..\$outputDir", + "/DPublishDir=$publishDir", + "/DMyOutputDir=$outputDir", "/DMyAppArch=$arch", - "`"$installerScript`"" - ) -join " " + $installerScript + ) - Write-Host "Compile command: $compileCmd" + Write-Host "Compile command: `"$isccPath`" $($compileArgs -join ' ')" # Execute the compiler - $output = Invoke-Expression $compileCmd 2>&1 - Write-Host $output + & $isccPath @compileArgs + if ($LASTEXITCODE -ne 0) { + Write-Error "Inno Setup compiler exited with code $LASTEXITCODE" + exit 1 + } # Check if build was successful $installerFile = Get-ChildItem -Path $outputDir -Filter "*.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 @@ -172,6 +189,7 @@ jobs: with: name: release-windows-${{ matrix.arch }} path: build-installer/*.exe + if-no-files-found: error retention-days: 30 build-linux: @@ -185,7 +203,7 @@ jobs: with: fetch-depth: 0 submodules: recursive - ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} + ref: ${{ needs.prepare.outputs.checkout_ref }} - name: Install dependencies run: | @@ -287,6 +305,7 @@ EOF with: name: release-linux path: "*.deb" + if-no-files-found: error retention-days: 30 build-macos: @@ -303,7 +322,7 @@ EOF with: fetch-depth: 0 submodules: recursive - ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} + ref: ${{ needs.prepare.outputs.checkout_ref }} - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -409,12 +428,12 @@ EOF with: name: release-macos-${{ matrix.arch }} path: "*.dmg" + if-no-files-found: error retention-days: 30 github-release: needs: [ prepare, build-windows, build-linux, build-macos ] runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') permissions: contents: write @@ -446,12 +465,20 @@ EOF ls -lh release-files/ || echo "⚠️ No files found in release-files" echo "" echo "📋 Total files:" - find release-files -type f | wc -l + file_count=$(find release-files -type f | wc -l) + echo "$file_count" + if [ "$file_count" -eq 0 ]; then + echo "Error: No installer/package files found for release" + exit 1 + fi - name: Create Release uses: ncipollo/release-action@v1 with: - tag: ${{ github.ref_name }} + tag: ${{ needs.prepare.outputs.tag }} + name: ${{ needs.prepare.outputs.tag }} + commit: ${{ github.sha }} + allowUpdates: true draft: false prerelease: ${{ github.event.inputs.is_prerelease == 'true' }} artifacts: "release-files/**" diff --git a/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml b/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml index d7c6177..7325a96 100644 --- a/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml +++ b/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml @@ -23,38 +23,24 @@ - - - - - - - - - + LineHeight="46" /> + LineHeight="46" /> diff --git a/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml.cs b/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml.cs index 3afddee..6ae0cdd 100644 --- a/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml.cs +++ b/LanMountainDesktop/Views/Components/DailyArtworkWidget.axaml.cs @@ -98,14 +98,12 @@ public partial class DailyArtworkWidget : UserControl, IDesktopComponentWidget, Math.Clamp(14 * scale, 8, 22)); DateInfoStack.Margin = new Thickness( - Math.Clamp(22 * scale, 10, 36), + Math.Clamp(18 * scale, 8, 30), 0, 0, - Math.Clamp(20 * scale, 10, 34)); + Math.Clamp(16 * scale, 8, 26)); DateInfoStack.Spacing = Math.Clamp(2 * scale, 1, 6); - ImageBottomShade.Height = Math.Clamp(132 * scale, 64, 182); - StatusTextBlock.FontSize = Math.Clamp(16 * scale, 10, 24); BrickPatternCanvas.Opacity = Math.Clamp(0.44 * scale, 0.20, 0.50); @@ -387,28 +385,28 @@ public partial class DailyArtworkWidget : UserControl, IDesktopComponentWidget, var leftPanelWidth = Math.Max(84, totalWidth - rightPanelWidth); var leftContentWidth = Math.Max(52, leftPanelWidth - DateInfoStack.Margin.Left - 10); - var dateBase = Math.Clamp(52 * scale, 18, 72); + var dateBase = Math.Clamp(44 * scale, 16, 62); DateTextBlock.FontSize = FitFontSize( DateTextBlock.Text, leftContentWidth, - Math.Max(22, totalHeight * 0.22), + Math.Max(18, totalHeight * 0.20), maxLines: 1, - minFontSize: Math.Max(14, dateBase * 0.70), + minFontSize: Math.Max(12, dateBase * 0.68), maxFontSize: dateBase, weight: FontWeight.Bold, - lineHeightFactor: 1.02); - DateTextBlock.LineHeight = DateTextBlock.FontSize * 1.02; + lineHeightFactor: 1.00); + DateTextBlock.LineHeight = DateTextBlock.FontSize * 1.00; WeekdayTextBlock.FontSize = FitFontSize( WeekdayTextBlock.Text, leftContentWidth, - Math.Max(22, totalHeight * 0.24), + Math.Max(18, totalHeight * 0.21), maxLines: 1, - minFontSize: Math.Max(14, dateBase * 0.70), + minFontSize: Math.Max(12, dateBase * 0.68), maxFontSize: dateBase, weight: FontWeight.Bold, - lineHeightFactor: 1.03); - WeekdayTextBlock.LineHeight = WeekdayTextBlock.FontSize * 1.03; + lineHeightFactor: 1.00); + WeekdayTextBlock.LineHeight = WeekdayTextBlock.FontSize * 1.00; var titleBase = Math.Clamp(44 * scale, 16, 58); PaintingTitleTextBlock.MaxWidth = rightContentWidth;