feat: Configure Node.js 24 for actions and enhance Windows build script for artifact packaging robustness.

This commit is contained in:
lml committed 2026-03-15 22:08:19 +08:00
1 parent a0412b8e60
commit 4c36bb5c95
1 file changed
+14 -10
+14 -10
View File
@@ -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