Skip to content

Commit b018e43

Browse files
authored
Update build.yml
1 parent 321d82a commit b018e43

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,26 @@ jobs:
106106
"ZIP_NAME=$(Split-Path -Leaf $zipPath)" | Out-File -FilePath $env:GITHUB_ENV -Append
107107
"ZIP_PATH=$zipPath" | Out-File -FilePath $env:GITHUB_ENV -Append
108108
109-
- name: Pack artifact (macOS/Linux)
110-
if: startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu')
109+
# Package (macOS/Linux)
110+
- name: Package artifact (*nix)
111+
if: runner.os != 'Windows'
112+
shell: bash
111113
run: |
112-
cd dist
113-
zip -r ../YT-Audio-Workbench-${{ runner.os }}.zip YT-Audio-Workbench
114-
echo "ZIP_NAME=YT-Audio-Workbench-${{ runner.os }}.zip" >> $GITHUB_ENV
114+
set -euo pipefail
115+
dist_dir="$(find dist -maxdepth 1 -type d -print | head -n1)"
116+
test -n "$dist_dir"
117+
zip_name="${ARTIFACT_BASENAME}.zip"
118+
(cd "$(dirname "$dist_dir")" && zip -r "../$zip_name" "$(basename "$dist_dir")" >/dev/null)
119+
echo "ZIP_NAME=$zip_name" >> "$GITHUB_ENV"
120+
121+
# Upload
115122
- name: Upload artifact
116123
uses: actions/upload-artifact@v4
117124
with:
118-
name: ${{ env.ZIP_NAME }}
119-
path: ${{ env.ZIP_PATH }}
125+
name: ${{ env.ARTIFACT_BASENAME }}
126+
path: ${{ env.ZIP_NAME }}
127+
if-no-files-found: error
128+
retention-days: 7
120129

121130
release:
122131
name: Release on tag

0 commit comments

Comments
 (0)