Skip to content

Commit cf30d42

Browse files
committed
ci: optimize sig file cat
1 parent 1a001f9 commit cf30d42

File tree

2 files changed

+47
-24
lines changed

2 files changed

+47
-24
lines changed

.github/workflows/build-test.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ jobs:
367367
name: changelog
368368
continue-on-error: true
369369

370+
- name: Download all build artifacts
371+
uses: actions/download-artifact@v7
372+
with:
373+
pattern: '*-build'
374+
merge-multiple: true
375+
path: artifacts
376+
370377
- name: Get release info
371378
id: release_info
372379
env:
@@ -403,41 +410,44 @@ jobs:
403410
NOTES="\"Release ${TAG}\""
404411
fi
405412
406-
# Function to get signature from .sig file URL
413+
# Function to read signature from local .sig file
407414
get_signature() {
408-
local sig_url="$1"
409-
local sig=$(curl -sL "$sig_url" 2>/dev/null || echo "")
410-
echo "$sig"
415+
local sig_file="$1"
416+
if [ -f "$sig_file" ]; then
417+
cat "$sig_file"
418+
else
419+
echo ""
420+
fi
411421
}
412422
413423
# Build platforms object
414424
# Windows x64
415425
WIN_X64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_x64-setup.exe"
416-
WIN_X64_SIG=$(get_signature "${WIN_X64_URL}.sig")
426+
WIN_X64_SIG=$(get_signature "artifacts/nsis/OpenList-Desktop_${VERSION}_x64-setup.exe.sig")
417427
418428
# Windows arm64
419429
WIN_ARM64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_arm64-setup.exe"
420-
WIN_ARM64_SIG=$(get_signature "${WIN_ARM64_URL}.sig")
430+
WIN_ARM64_SIG=$(get_signature "artifacts/nsis/OpenList-Desktop_${VERSION}_arm64-setup.exe.sig")
421431
422432
# macOS arm64 (Apple Silicon)
423433
MAC_ARM64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_aarch64.app.tar.gz"
424-
MAC_ARM64_SIG=$(get_signature "${MAC_ARM64_URL}.sig")
434+
MAC_ARM64_SIG=$(get_signature "artifacts/macos/OpenList-Desktop-${VERSION}-arm64.app.tar.gz.sig")
425435
426436
# macOS x64 (Intel)
427437
MAC_X64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_x64.app.tar.gz"
428-
MAC_X64_SIG=$(get_signature "${MAC_X64_URL}.sig")
438+
MAC_X64_SIG=$(get_signature "artifacts/macos/OpenList-Desktop-${VERSION}-x64.app.tar.gz.sig")
429439
430440
# Linux x64
431441
LINUX_X64_DEB_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_amd64.deb"
432-
LINUX_X64_DEB_SIG=$(get_signature "${LINUX_X64_DEB_URL}.sig")
442+
LINUX_X64_DEB_SIG=$(get_signature "artifacts/deb/openlist-desktop_${VERSION}_amd64.deb.sig")
433443
434444
# Linux arm64
435445
LINUX_ARM64_DEB_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_arm64.deb"
436-
LINUX_ARM64_DEB_SIG=$(get_signature "${LINUX_ARM64_DEB_URL}.sig")
446+
LINUX_ARM64_DEB_SIG=$(get_signature "artifacts/deb/openlist-desktop_${VERSION}_arm64.deb.sig")
437447
438448
# Linux armhf
439449
LINUX_ARMHF_DEB_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_armhf.deb"
440-
LINUX_ARMHF_DEB_SIG=$(get_signature "${LINUX_ARMHF_DEB_URL}.sig")
450+
LINUX_ARMHF_DEB_SIG=$(get_signature "artifacts/deb/openlist-desktop_${VERSION}_armhf.deb.sig")
441451
442452
# Create latest.json
443453
cat > latest.json << EOF

.github/workflows/release.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,20 @@ jobs:
385385
- name: Checkout
386386
uses: actions/checkout@v6
387387

388-
- name: Download changelog
388+
- name: Download all build artifacts
389389
uses: actions/download-artifact@v7
390390
with:
391-
name: changelog
391+
pattern: '*-build'
392+
merge-multiple: true
393+
path: artifacts
394+
continue-on-error: true
395+
396+
- name: Download ARM artifacts
397+
uses: actions/download-artifact@v7
398+
with:
399+
pattern: '*-artifacts'
400+
merge-multiple: true
401+
path: artifacts
392402
continue-on-error: true
393403

394404
- name: Get release info
@@ -427,41 +437,44 @@ jobs:
427437
NOTES="\"Release ${TAG}\""
428438
fi
429439
430-
# Function to get signature from .sig file URL
440+
# Function to read signature from local .sig file
431441
get_signature() {
432-
local sig_url="$1"
433-
local sig=$(curl -sL "$sig_url" 2>/dev/null || echo "")
434-
echo "$sig"
442+
local sig_file="$1"
443+
if [ -f "$sig_file" ]; then
444+
cat "$sig_file"
445+
else
446+
echo ""
447+
fi
435448
}
436449
437450
# Build platforms object
438451
# Windows x64
439452
WIN_X64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_x64-setup.exe"
440-
WIN_X64_SIG=$(get_signature "${WIN_X64_URL}.sig")
453+
WIN_X64_SIG=$(get_signature "artifacts/nsis/OpenList-Desktop_${VERSION}_x64-setup.exe.sig")
441454
442455
# Windows arm64
443456
WIN_ARM64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_arm64-setup.exe"
444-
WIN_ARM64_SIG=$(get_signature "${WIN_ARM64_URL}.sig")
457+
WIN_ARM64_SIG=$(get_signature "artifacts/nsis/OpenList-Desktop_${VERSION}_arm64-setup.exe.sig")
445458
446459
# macOS arm64 (Apple Silicon)
447460
MAC_ARM64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_aarch64.app.tar.gz"
448-
MAC_ARM64_SIG=$(get_signature "${MAC_ARM64_URL}.sig")
461+
MAC_ARM64_SIG=$(get_signature "artifacts/macos/OpenList-Desktop-${VERSION}-arm64.app.tar.gz.sig")
449462
450463
# macOS x64 (Intel)
451464
MAC_X64_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_x64.app.tar.gz"
452-
MAC_X64_SIG=$(get_signature "${MAC_X64_URL}.sig")
465+
MAC_X64_SIG=$(get_signature "artifacts/macos/OpenList-Desktop-${VERSION}-x64.app.tar.gz.sig")
453466
454467
# Linux x64
455468
LINUX_X64_DEB_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_amd64.deb"
456-
LINUX_X64_DEB_SIG=$(get_signature "${LINUX_X64_DEB_URL}.sig")
469+
LINUX_X64_DEB_SIG=$(get_signature "artifacts/deb/openlist-desktop_${VERSION}_amd64.deb.sig")
457470
458471
# Linux arm64
459472
LINUX_ARM64_DEB_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_arm64.deb"
460-
LINUX_ARM64_DEB_SIG=$(get_signature "${LINUX_ARM64_DEB_URL}.sig")
473+
LINUX_ARM64_DEB_SIG=$(get_signature "artifacts/deb/openlist-desktop_${VERSION}_arm64.deb.sig")
461474
462475
# Linux armhf
463476
LINUX_ARMHF_DEB_URL="${BASE_URL}/OpenList-Desktop_${VERSION}_armhf.deb"
464-
LINUX_ARMHF_DEB_SIG=$(get_signature "${LINUX_ARMHF_DEB_URL}.sig")
477+
LINUX_ARMHF_DEB_SIG=$(get_signature "artifacts/deb/openlist-desktop_${VERSION}_armhf.deb.sig")
465478
466479
# Create latest.json
467480
cat > latest.json << EOF

0 commit comments

Comments
 (0)