From 4c36bb5c95bdcb611fac64f44bd57b44b3ff8578 Mon Sep 17 00:00:00 2001 From: lml Date: Sun, 15 Mar 2026 22:08:19 +0800 Subject: [PATCH] feat: Configure Node.js 24 for actions and enhance Windows build script for artifact packaging robustness. --- .github/workflows/release.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a9a2e94..a6443ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,8 @@ on: - 'v*' workflow_dispatch: -permissions: - contents: write +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: build-macos: @@ -79,17 +79,21 @@ jobs: shell: pwsh run: | $APP_NAME = "caption_trans" - $RELEASE_DIR = "build\windows\x64\runner\Release" - $ZIP_NAME = "${APP_NAME}-windows-x64.zip" + $WORKSPACE = "${{ github.workspace }}" + $BUILD_OUTPUT = Join-Path $WORKSPACE "build\windows\x64\runner\Release" + $ZIP_NAME = Join-Path $WORKSPACE "${APP_NAME}-windows-x64.zip" - # Verify directory exists - if (!(Test-Path $RELEASE_DIR)) { - Write-Error "Release directory not found: $RELEASE_DIR" + Write-Host "Checking for build output at: $BUILD_OUTPUT" + + if (Test-Path $BUILD_OUTPUT) { + Write-Host "Found release directory. Packaging..." + Compress-Archive -Path "$BUILD_OUTPUT\*" -DestinationPath "$ZIP_NAME" -Force + } else { + Write-Host "!!! Error: Release directory not found at expected path !!!" + Write-Host "Listing $WORKSPACE contents:" + Get-ChildItem -Path $WORKSPACE -Recurse -Depth 3 | Select-Object FullName exit 1 } - - # Package using relative path to avoid prefix issues - Compress-Archive -Path "$RELEASE_DIR\*" -DestinationPath "$ZIP_NAME" -Force - name: Upload Windows Artifact uses: actions/upload-artifact@v4