mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-16 19:33:11 +02:00
Don't build mac if you don't have the secrets (#5861)
Don't build mac if signing secrets unnavailable. No point in trying to build without signing as you cannot install it on a mac without signature.
This commit is contained in:
@@ -14,7 +14,7 @@ on:
|
|||||||
- macos
|
- macos
|
||||||
- linux
|
- linux
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main, V2-tauri-windows]
|
branches: [main]
|
||||||
types: [opened, reopened, synchronize, ready_for_review]
|
types: [opened, reopened, synchronize, ready_for_review]
|
||||||
paths:
|
paths:
|
||||||
- "frontend/src-tauri/**"
|
- "frontend/src-tauri/**"
|
||||||
@@ -43,27 +43,42 @@ jobs:
|
|||||||
|
|
||||||
- name: Determine build matrix
|
- name: Determine build matrix
|
||||||
id: set-matrix
|
id: set-matrix
|
||||||
|
env:
|
||||||
|
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||||
run: |
|
run: |
|
||||||
|
WINDOWS='{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"}'
|
||||||
|
MACOS_ARM='{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"}'
|
||||||
|
MACOS_INTEL='{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"}'
|
||||||
|
LINUX='{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}'
|
||||||
|
|
||||||
|
# Resolve requested platform (non-dispatch events always build all)
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||||
case "${{ github.event.inputs.platform }}" in
|
PLATFORM="${{ github.event.inputs.platform }}"
|
||||||
"windows")
|
|
||||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"}]}' >> $GITHUB_OUTPUT
|
|
||||||
;;
|
|
||||||
"macos")
|
|
||||||
echo 'matrix={"include":[{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"}]}' >> $GITHUB_OUTPUT
|
|
||||||
;;
|
|
||||||
"linux")
|
|
||||||
echo 'matrix={"include":[{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
else
|
||||||
# For PR/push events, build all platforms
|
PLATFORM="all"
|
||||||
echo 'matrix={"include":[{"platform":"windows-latest","args":"--target x86_64-pc-windows-msvc","name":"windows-x86_64"},{"platform":"macos-15","args":"--target aarch64-apple-darwin","name":"macos-aarch64"},{"platform":"macos-15-intel","args":"--target x86_64-apple-darwin","name":"macos-x86_64"},{"platform":"ubuntu-22.04","args":"","name":"linux-x86_64"}]}' >> $GITHUB_OUTPUT
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Build candidate list
|
||||||
|
case "$PLATFORM" in
|
||||||
|
windows) ENTRIES=("$WINDOWS") ;;
|
||||||
|
macos) ENTRIES=("$MACOS_ARM" "$MACOS_INTEL") ;;
|
||||||
|
linux) ENTRIES=("$LINUX") ;;
|
||||||
|
*) ENTRIES=("$WINDOWS" "$MACOS_ARM" "$MACOS_INTEL" "$LINUX") ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Drop macOS entries when Apple certificate secret is unavailable
|
||||||
|
if [ -z "$APPLE_CERTIFICATE" ]; then
|
||||||
|
echo "⚠️ APPLE_CERTIFICATE secret not available - skipping macOS builds"
|
||||||
|
FILTERED=()
|
||||||
|
for entry in "${ENTRIES[@]}"; do
|
||||||
|
[[ "$entry" != *'"macos'* ]] && FILTERED+=("$entry")
|
||||||
|
done
|
||||||
|
ENTRIES=("${FILTERED[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
JOINED=$(IFS=','; echo "${ENTRIES[*]}")
|
||||||
|
echo "matrix={\"include\":[$JOINED]}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
build:
|
build:
|
||||||
needs: determine-matrix
|
needs: determine-matrix
|
||||||
strategy:
|
strategy:
|
||||||
|
|||||||
Reference in New Issue
Block a user