From 7a557027be2cf366bf3552a8e88cca07b49e102c Mon Sep 17 00:00:00 2001 From: arabcoders Date: Mon, 7 Jul 2025 16:39:05 +0300 Subject: [PATCH] split windows and nix oses packaging. --- .github/workflows/native-build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/native-build.yml b/.github/workflows/native-build.yml index 0ec6c4ba..b2d9db76 100644 --- a/.github/workflows/native-build.yml +++ b/.github/workflows/native-build.yml @@ -115,8 +115,8 @@ jobs: name: app-${{ runner.os }}-${{ matrix.arch }}-${{ env.TAG_NAME }} path: dist/* - - name: Package artifact - if: startsWith(env.TAG_NAME, 'v') + - name: Package artifact (Unix) + if: startsWith(env.TAG_NAME, 'v') && runner.os != 'Windows' run: | mkdir -p release ZIP_NAME="ytptube-${{ runner.os }}-${{ matrix.arch }}-${{ env.TAG_NAME }}.zip" @@ -128,6 +128,20 @@ jobs: zip -r "release/${ZIP_NAME}" dist/ + - name: Package artifact (Windows) + if: startsWith(env.TAG_NAME, 'v') && runner.os == 'Windows' + shell: powershell + run: | + $zipName = "ytptube-${{ runner.os }}-${{ matrix.arch }}-${{ env.TAG_NAME }}.zip" + New-Item -ItemType Directory -Force -Path release | Out-Null + + if (!(Test-Path dist) -or !(Get-ChildItem -Path dist)) { + Write-Host "dist directory is empty, skipping packaging." + exit 1 + } + + Compress-Archive -Path dist\* -DestinationPath "release\$zipName" + - name: Upload to GitHub Release if: startsWith(env.TAG_NAME, 'v') uses: softprops/action-gh-release@v2