summaryrefslogtreecommitdiff
path: root/.github/workflows/build-macos.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/build-macos.yml')
-rw-r--r--.github/workflows/build-macos.yml207
1 files changed, 131 insertions, 76 deletions
diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml
index 274270d3..5c11c62b 100644
--- a/.github/workflows/build-macos.yml
+++ b/.github/workflows/build-macos.yml
@@ -27,6 +27,11 @@ on:
description: "macOS deployment target version"
required: true
type: string
+ cold_build:
+ description: "Bypass workflow dependency and compiler caches without saving them"
+ required: false
+ type: boolean
+ default: false
recache:
description: "Force ccache to recompile and refresh cached objects"
required: false
@@ -37,16 +42,6 @@ on:
required: false
type: boolean
default: false
- release_channel:
- description: "Build release channel: DEVEL, RC, or GA"
- required: false
- type: string
- default: "DEVEL"
- rc_number:
- description: "Release candidate number when release_channel is RC"
- required: false
- type: string
- default: ""
signing_mode:
description: "Package signing policy: validation or distribution"
required: false
@@ -111,6 +106,11 @@ on:
- arm64
- x86_64
default: "arm64"
+ cold_build:
+ description: "Bypass workflow dependency and compiler caches without saving them"
+ required: false
+ type: boolean
+ default: false
recache:
description: "Force ccache to recompile and refresh cached objects"
required: false
@@ -127,11 +127,12 @@ on:
type: choice
options:
- DEVEL
+ - BETA
- RC
- GA
default: "DEVEL"
- rc_number:
- description: "Release candidate number when release_channel is RC"
+ prerelease_number:
+ description: "Prerelease number when release_channel is BETA or RC"
required: false
type: string
default: ""
@@ -164,14 +165,14 @@ jobs:
# runs-on cannot reference job-level env, so keep this expression and RUNNER
# aligned. RUNNER also keeps cache keys consistent across both triggers.
runs-on: ${{ inputs.runner || (inputs.arch == 'x86_64' && 'macos-15-intel' || 'macos-15') }}
- timeout-minutes: 45
+ timeout-minutes: 180
env:
RUNNER: ${{ inputs.runner || (inputs.arch == 'x86_64' && 'macos-15-intel' || 'macos-15') }}
DEPLOYMENT_TARGET: ${{ inputs.deployment_target || (inputs.arch == 'x86_64' && '10.13' || '11.0') }}
VERSION: ${{ inputs.version }}
HAMLIB_BRANCH: ${{ inputs.hamlib_branch }}
WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }}
- WSJT_RC_NUMBER: ${{ inputs.rc_number }}
+ WSJT_PRERELEASE_NUMBER: ${{ inputs.prerelease_number }}
SIGNING_MODE: ${{ inputs.signing_mode }}
ARCH: ${{ inputs.arch }}
BOOST_VERSION: 1.85.0
@@ -226,6 +227,7 @@ jobs:
- name: Restore ccache
id: ccache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: .ccache
@@ -235,7 +237,11 @@ jobs:
- name: Configure ccache
run: |
- echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> "$GITHUB_ENV"
+ if [ "${{ inputs.cold_build }}" = "true" ]; then
+ echo "CCACHE_DIR=$(mktemp -d "${RUNNER_TEMP}/wsjtx-ccache.XXXXXX")" >> "$GITHUB_ENV"
+ else
+ echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> "$GITHUB_ENV"
+ fi
echo "ccache recache: ${{ inputs.recache }}"
if [ "${{ inputs.recache }}" = "true" ]; then
echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV"
@@ -256,12 +262,14 @@ jobs:
- name: Restore Qt cache
id: qt-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: qt-prefix
key: ${{ steps.qt-key.outputs.key }}
- name: Build Qt
+ id: qt-build
if: steps.qt-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/build-qt-macos.sh \
@@ -270,7 +278,7 @@ jobs:
--prefix "${GITHUB_WORKSPACE}/qt-prefix"
- name: Save Qt cache
- if: steps.qt-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.qt-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: qt-prefix
@@ -350,12 +358,14 @@ jobs:
- name: Restore libusb cache
id: libusb-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: libusb-prefix
key: libusb-macos-${{ inputs.arch }}-${{ env.RUNNER }}-1.0.27-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-libusb-macos.sh') }}
- name: Build libusb
+ id: libusb-build
if: steps.libusb-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/build-libusb-macos.sh \
@@ -364,7 +374,7 @@ jobs:
"${GITHUB_WORKSPACE}/libusb-prefix"
- name: Save libusb cache
- if: steps.libusb-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.libusb-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: libusb-prefix
@@ -372,12 +382,14 @@ jobs:
- name: Restore PortAudio cache
id: portaudio-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: portaudio-prefix
key: portaudio-macos-${{ inputs.arch }}-${{ env.RUNNER }}-19.7.0-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-portaudio-macos.sh') }}
- name: Build PortAudio
+ id: portaudio-build
if: steps.portaudio-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/build-portaudio-macos.sh \
@@ -386,7 +398,7 @@ jobs:
"${GITHUB_WORKSPACE}/portaudio-prefix"
- name: Save PortAudio cache
- if: steps.portaudio-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.portaudio-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: portaudio-prefix
@@ -394,12 +406,14 @@ jobs:
- name: Restore FFTW cache
id: fftw-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: fftw-prefix
key: fftw-macos-${{ inputs.arch }}-${{ env.RUNNER }}-3.3.10-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-fftw-macos.sh') }}
- name: Build FFTW
+ id: fftw-build
if: steps.fftw-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/build-fftw-macos.sh \
@@ -408,7 +422,7 @@ jobs:
"${GITHUB_WORKSPACE}/fftw-prefix"
- name: Save FFTW cache
- if: steps.fftw-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.fftw-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: fftw-prefix
@@ -416,12 +430,14 @@ jobs:
- name: Restore Boost cache
id: boost-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: boost-prefix
key: boost-macos-${{ inputs.arch }}-${{ env.RUNNER }}-${{ env.BOOST_VERSION }}-${{ env.BOOST_SOURCE_SHA256 }}-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-boost-macos.sh') }}
- name: Build Boost
+ id: boost-build
if: steps.boost-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/build-boost-macos.sh \
@@ -432,7 +448,7 @@ jobs:
"${GITHUB_WORKSPACE}/boost-prefix"
- name: Save Boost cache
- if: steps.boost-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.boost-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: boost-prefix
@@ -454,12 +470,14 @@ jobs:
- name: Restore Hamlib cache
id: hamlib-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: hamlib-prefix
key: hamlib-macos-${{ inputs.arch }}-${{ env.RUNNER }}-${{ inputs.hamlib_branch }}-libusb1.0.27-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-hamlib-macos.sh', '.github/scripts/build-libusb-macos.sh') }}
- name: Build Hamlib
+ id: hamlib-build
if: steps.hamlib-cache.outputs.cache-hit != 'true'
run: |
.github/scripts/build-hamlib-macos.sh \
@@ -478,7 +496,7 @@ jobs:
"${GITHUB_WORKSPACE}/hamlib-prefix/lib/libhamlib.a"
- name: Save Hamlib cache
- if: steps.hamlib-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.hamlib-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: hamlib-prefix
@@ -486,12 +504,14 @@ jobs:
- name: Restore pFUnit cache
id: pfunit-cache
+ if: ${{ !inputs.cold_build }}
uses: actions/cache/restore@v6
with:
path: pfunit-prefix
key: pfunit-macos-${{ inputs.arch }}-${{ env.RUNNER }}-v4.14.0-${{ steps.fc.outputs.cache_key }}-min${{ env.DEPLOYMENT_TARGET }}-epoch3-${{ hashFiles('.github/scripts/build-pfunit-macos.sh') }}
- name: Build pFUnit
+ id: pfunit-build
if: steps.pfunit-cache.outputs.cache-hit != 'true'
env:
# pFUnit configure uses try_run probes; expose only the controlled
@@ -518,7 +538,7 @@ jobs:
echo "dir=${PFUNIT_DIR}" >> "$GITHUB_OUTPUT"
- name: Save pFUnit cache
- if: steps.pfunit-cache.outputs.cache-hit != 'true'
+ if: ${{ !inputs.cold_build && steps.pfunit-cache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: pfunit-prefix
@@ -544,56 +564,24 @@ jobs:
-DPFUNIT_DIR="${{ steps.pfunit.outputs.dir }}" \
-DWSJT_SOURCE_REVISION="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}" \
-DWSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL}" \
- -DWSJT_RC_NUMBER="${WSJT_RC_NUMBER}" \
+ -DWSJT_PRERELEASE_NUMBER="${WSJT_PRERELEASE_NUMBER}" \
-Wno-dev
- name: Build and test targets
+ id: compile
run: cmake --build wsjtx-build -j"$(sysctl -n hw.ncpu)"
- name: Report suppressed ccache save
- if: ${{ (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }}
+ if: ${{ !inputs.cold_build && (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }}
run: echo "::notice::Not saving ccache because shared compiler caches are published only from develop"
- name: Save ccache
- if: ${{ success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }}
+ if: ${{ !inputs.cold_build && success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v6
with:
path: .ccache
key: ${{ steps.ccache.outputs.cache-primary-key }}
- - name: Apply WSJT-X shared memory limits
- run: |
- python3 - <<'PY'
- import plistlib
- import subprocess
-
- expected_arguments = [
- "/usr/sbin/sysctl",
- "kern.sysv.shmmax=52428800",
- "kern.sysv.shmall=25600",
- ]
-
- with open("Darwin/com.wsjtx.sysctl.plist", "rb") as source:
- configuration = plistlib.load(source)
-
- if (
- configuration.get("Program") != expected_arguments[0]
- or configuration.get("ProgramArguments") != expected_arguments
- ):
- raise SystemExit("shared memory plist does not match CI expectations")
-
- subprocess.run(["/usr/bin/sudo", *expected_arguments], check=True)
- subprocess.run(
- [expected_arguments[0], "kern.sysv.shmmax", "kern.sysv.shmall"], check=True
- )
- PY
-
- - name: Raise shared memory total for parallel GUI tests
- run: |
- # Three decoder segments require 35,359 pages; leave headroom for other IPC.
- sudo /usr/sbin/sysctl kern.sysv.shmall=40960
- /usr/sbin/sysctl kern.sysv.shmmax kern.sysv.shmall
-
- name: Run tests
id: ctest
run: ctest --parallel 3 --output-on-failure --output-junit ctest-results.xml
@@ -660,13 +648,19 @@ jobs:
fi
done
- for bin in jt9 wsprd wsprcode jt65code jt4code ft8code q65code encode77 fcal hash22calc; do
- [ -f "${BUILD}/${bin}" ] && cp "${BUILD}/${bin}" "${ASSETS}/"
- done
-
- for bin in ft4sim jt4sim jt65sim cwsim sfoxsim echosim EchoCallSim; do
- [ -f "${BUILD}/${bin}" ] && cp "${BUILD}/${bin}" "${ASSETS}/"
- done
+ missing=()
+ while IFS= read -r bin; do
+ [ -n "${bin}" ] || continue
+ if [ -f "${BUILD}/${bin}" ]; then
+ cp "${BUILD}/${bin}" "${ASSETS}/"
+ else
+ missing+=("${bin}")
+ fi
+ done < "${BUILD}/cli-tools.txt"
+ if [ "${#missing[@]}" -gt 0 ]; then
+ echo "::error::CLI tools listed in ${BUILD}/cli-tools.txt were not built: ${missing[*]}"
+ exit 1
+ fi
echo "stage_dir=${STAGE}" >> "$GITHUB_OUTPUT"
echo "assets_dir=${ASSETS}" >> "$GITHUB_OUTPUT"
@@ -819,25 +813,50 @@ jobs:
PAYLOAD="$RUNNER_TEMP/pkg-payload"
SCRIPTS="$RUNNER_TEMP/pkg-scripts"
- mkdir -p "${PAYLOAD}/Applications" "${PAYLOAD}/Library/LaunchDaemons" "${SCRIPTS}"
+ mkdir -p "${PAYLOAD}/Applications" "${SCRIPTS}"
cp -R "${STAGE}/wsjtx.app" "${PAYLOAD}/Applications/"
mkdir -p "${PAYLOAD}/usr/local/wsjtx/lib"
- for bin in "${STAGE}"/*; do
- [ -f "$bin" ] && [ -x "$bin" ] && cp "$bin" "${PAYLOAD}/usr/local/wsjtx/"
- done
+ missing=()
+ while IFS= read -r bin; do
+ [ -n "${bin}" ] || continue
+ if [ -f "${STAGE}/${bin}" ]; then
+ cp "${STAGE}/${bin}" "${PAYLOAD}/usr/local/wsjtx/"
+ else
+ missing+=("${bin}")
+ fi
+ done < wsjtx-build/installed-cli-tools.txt
+ if [ "${#missing[@]}" -gt 0 ]; then
+ echo "::error::CLI tools listed in wsjtx-build/installed-cli-tools.txt are missing from ${STAGE}: ${missing[*]}"
+ exit 1
+ fi
[ -d "${STAGE}/lib" ] && cp -R "${STAGE}/lib/"* "${PAYLOAD}/usr/local/wsjtx/lib/"
- cp "Darwin/com.wsjtx.sysctl.plist" "${PAYLOAD}/Library/LaunchDaemons/"
-
+ cp wsjtx-build/installed-cli-tools.txt "${SCRIPTS}/"
cat > "${SCRIPTS}/postinstall" << 'SCRIPT'
#!/bin/bash
- /bin/launchctl load /Library/LaunchDaemons/com.wsjtx.sysctl.plist 2>/dev/null || true
- /usr/sbin/sysctl kern.sysv.shmmax=52428800 kern.sysv.shmall=25600 2>/dev/null || true
- mkdir -p /usr/local/bin
- for bin in /usr/local/wsjtx/*; do
- [ -f "$bin" ] && [ -x "$bin" ] && ln -sf "$bin" "/usr/local/bin/$(basename "$bin")"
+ root="${3%/}" # $3 is the installation's target volume
+ shipped="$(dirname "$0")/installed-cli-tools.txt"
+ mkdir -p "$root/usr/local/bin"
+ if [ -s "$shipped" ] && [ ! -L "$root/usr/local/wsjtx" ]; then
+ for bin in "$root"/usr/local/wsjtx/*; do
+ [ -f "$bin" ] && [ -x "$bin" ] || continue
+ name=$(basename "$bin")
+ grep -qxF -- "$name" "$shipped" && continue
+ rm -f "$bin"
+ link="$root/usr/local/bin/$name"
+ if [ -L "$link" ] && [ ! -e "$link" ]; then
+ case "$(readlink "$link")" in
+ "$root"/usr/local/wsjtx/*) rm -f "$link" ;;
+ esac
+ fi
+ done
+ fi
+ for bin in "$root"/usr/local/wsjtx/*; do
+ if [ -f "$bin" ] && [ -x "$bin" ]; then
+ ln -sf "$bin" "$root/usr/local/bin/$(basename "$bin")"
+ fi
done
SCRIPT
chmod +x "${SCRIPTS}/postinstall"
@@ -975,6 +994,33 @@ jobs:
name: individual-binaries-macos-${{ inputs.arch }}
path: packages/*.tar.gz
+ - name: Package release tarballs
+ run: |
+ .github/scripts/package-cli-tools.sh \
+ --platform macos \
+ --version "${{ inputs.version }}" \
+ --arch "${{ inputs.arch }}" \
+ --groups CMake/release-tarballs.txt \
+ --source "${{ steps.collect.outputs.assets_dir }}" \
+ --out release-tarballs
+
+ - name: Smoke-test release tarballs
+ timeout-minutes: 5
+ run: |
+ .github/scripts/smoke-release-tarballs.sh \
+ --platform macos \
+ --version "${{ inputs.version }}" \
+ --target "${{ inputs.arch }}-macOS" \
+ --groups CMake/release-tarballs.txt \
+ --dir release-tarballs
+
+ - name: Upload release tarballs
+ uses: ./.github/actions/upload-release-tarballs
+ with:
+ version: ${{ inputs.version }}
+ target: ${{ inputs.arch }}-macOS
+ directory: release-tarballs
+
# Keep repository-built code after signing, notarization, cleanup, and
# artifact publication so a detached child cannot reach later secrets.
- name: Smoke-launch deployed WSJT-X app
@@ -1015,6 +1061,15 @@ jobs:
if-no-files-found: ignore
retention-days: 7
+ - name: Summarize native caches
+ if: always()
+ shell: bash
+ env:
+ CACHE_STEPS: ${{ toJSON(steps) }}
+ COLD_BUILD: ${{ inputs.cold_build }}
+ RECACHE: ${{ inputs.recache }}
+ run: python3 .github/scripts/summarize-native-caches.py --compiler qt libusb portaudio fftw boost hamlib pfunit >> "$GITHUB_STEP_SUMMARY"
+
sign_distribution:
if: inputs.signing_mode == 'distribution'
needs: build