Skip to content

Boost 1.78.0

Boost 1.78.0 #61

Workflow file for this run

name: Build and release Boost for iOS
on:
workflow_dispatch:
inputs:
boost_version:
description: Boost version to build
required: true
default: 1.78.0
type: string
push:
branches:
- master
tags:
- "[0-9]*.[0-9]*.[0-9]*"
permissions:
contents: write
concurrency:
group: boost-release-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
# Intel is required for the x86_64 Simulator slice in these legacy releases.
runs-on: macos-15-intel
env:
# Master validates the newest supported version. Tag pushes are replaced
# with the exact tag by the Resolve tag version step below.
BOOST_VERSION: ${{ inputs.boost_version || '1.78.0' }}
IOS_MIN_VERSION: "12.0"
steps:
- name: Check out repository
uses: actions/checkout@v7.0.1
- name: Resolve tag version
if: startsWith(github.ref, 'refs/tags/')
run: echo "BOOST_VERSION=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
- name: Validate supported release
run: case "$BOOST_VERSION" in 1.61.0|1.62.0|1.63.0|1.64.0|1.65.0|1.66.0|1.67.0|1.68.0|1.69.0|1.70.0|1.71.0|1.72.0|1.73.0|1.74.0|1.75.0|1.76.0|1.77.0|1.78.0) ;; *) exit 1 ;; esac
- name: Build release archive
run: |
log="$RUNNER_TEMP/build-release.log"
if ! ./scripts/build-boost-ios.sh >"$log" 2>&1; then
tail -n 200 "$log"
exit 1
fi
echo "Built Boost ${BOOST_VERSION} release archive."
- name: Inspect binary
run: |
package="dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz"
work="$(mktemp -d)"
tar -xzf "$package" -C "$work"
framework="$work/ofxiOSBoost-${BOOST_VERSION}/libs/boost/ios/boost.xcframework"
plutil -lint "$framework/Info.plist"
device_lib="$(find "$framework" -path '*ios-arm64/libboost.a' -print -quit)"
simulator_lib="$(find "$framework" -path '*ios-arm64_x86_64-simulator/libboost.a' -print -quit)"
test "$(xcrun lipo -archs "$device_lib")" = "arm64"
test "$(xcrun lipo -archs "$simulator_lib")" = "x86_64 arm64"
if [[ "$BOOST_VERSION" == "1.65.0" || "$BOOST_VERSION" == "1.66.0" || "$BOOST_VERSION" == "1.67.0" || "$BOOST_VERSION" == "1.68.0" || "$BOOST_VERSION" == "1.69.0" || "$BOOST_VERSION" == "1.70.0" || "$BOOST_VERSION" == "1.71.0" || "$BOOST_VERSION" == "1.72.0" || "$BOOST_VERSION" == "1.73.0" || "$BOOST_VERSION" == "1.74.0" || "$BOOST_VERSION" == "1.75.0" || "$BOOST_VERSION" == "1.76.0" || "$BOOST_VERSION" == "1.77.0" || "$BOOST_VERSION" == "1.78.0" ]]; then
xcrun nm -arch arm64 -gU "$device_lib" > "$work/device-arm64.nm"
xcrun nm -arch arm64 -gU "$simulator_lib" > "$work/simulator-arm64.nm"
xcrun nm -arch x86_64 -gU "$simulator_lib" > "$work/simulator-x86_64.nm"
for symbol in _make_fcontext _jump_fcontext _ontop_fcontext; do
grep -Fq "$symbol" "$work/device-arm64.nm"
grep -Fq "$symbol" "$work/simulator-arm64.nm"
grep -Fq "$symbol" "$work/simulator-x86_64.nm"
done
fi
- name: Build XCFramework example
run: |
log="$RUNNER_TEMP/xcframework-example.log"
if ! ./example-xcframework/build.sh \
"dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz" >"$log" 2>&1; then
tail -n 200 "$log"
exit 1
fi
echo "Validated the XCFramework example."
- name: Run XCFramework smoke tests in iOS Simulator
run: |
package_dir="$RUNNER_TEMP/ofxiOSBoost-${BOOST_VERSION}"
app_dir="$RUNNER_TEMP/ofxiOSBoost-smoke-app"
report="$RUNNER_TEMP/ofxiOSBoost-smoke-report.txt"
mkdir -p "$package_dir" "libs/boost/ios" "$app_dir"
tar -xzf "dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz" \
-C "$package_dir" --strip-components=1
ditto "$package_dir/libs/boost/ios/boost.xcframework" \
"libs/boost/ios/boost.xcframework"
udid="$(xcrun simctl list devices available -j | jq -r \
'[.devices[][] | select(.isAvailable == true and (.name | startswith("iPhone")))] | first | .udid // empty')"
test -n "$udid"
xcrun simctl boot "$udid" 2>/dev/null || true
xcrun simctl bootstatus "$udid" -b
build_log="$RUNNER_TEMP/simulator-smoke-build.log"
if ! xcodebuild \
-project example-xcframework/ofxiOSBoostContextExample.xcodeproj \
-target ofxiOSBoostContextExample \
-configuration Release \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,id=$udid" \
CONFIGURATION_BUILD_DIR="$app_dir" \
CODE_SIGNING_ALLOWED=NO \
build >"$build_log" 2>&1; then
tail -n 200 "$build_log"
exit 1
fi
xcrun simctl install "$udid" \
"$app_dir/ofxiOSBoostContextExample.app"
container="$(xcrun simctl get_app_container "$udid" \
org.openframeworks.ofxiOSBoostContextExample data)"
app_report="$container/tmp/ofxiOSBoost-smoke-report.txt"
rm -f "$app_report"
SIMCTL_CHILD_OFXIOSBOOST_CI=1 xcrun simctl launch "$udid" \
org.openframeworks.ofxiOSBoostContextExample
for _ in {1..60}; do
if [[ -s "$app_report" ]]; then
break
fi
sleep 1
done
if [[ ! -s "$app_report" ]]; then
xcrun simctl spawn "$udid" log show --last 2m --style compact \
--predicate 'process == "ofxiOSBoostContextExample"' | tail -n 100
exit 1
fi
cp "$app_report" "$report"
cat "$report"
{
echo "### Boost ${BOOST_VERSION} iOS Simulator smoke tests"
echo '```text'
cat "$report"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
grep -Fq "ALL TESTS PASSED" "$report"
- name: Build Swift package example
run: |
log="$RUNNER_TEMP/swift-package-example.log"
if ! ./example-swift-package/build.sh \
"dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz" >"$log" 2>&1; then
tail -n 200 "$log"
exit 1
fi
echo "Validated the Swift package example."
- name: Install CocoaPods
run: |
log="$RUNNER_TEMP/cocoapods-install.log"
if ! sudo gem install cocoapods --no-document >"$log" 2>&1; then
tail -n 200 "$log"
exit 1
fi
echo "Installed CocoaPods."
- name: Validate CocoaPods package
run: |
work="$(mktemp -d)"
tar -xzf "dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz" -C "$work"
package="$work/ofxiOSBoost-${BOOST_VERSION}"
cp "dist/ofxiOSBoost.podspec" "$package/ofxiOSBoost.podspec"
cd "$package"
log="$RUNNER_TEMP/cocoapods-lib-lint.log"
if ! pod lib lint ofxiOSBoost.podspec --platforms=ios >"$log" 2>&1; then
tail -n 200 "$log"
exit 1
fi
echo "Validated the CocoaPods package."
- name: Upload workflow artifact
uses: actions/upload-artifact@v7.0.1
with:
name: ofxiOSBoost-${{ env.BOOST_VERSION }}
path: |
dist/ofxiOSBoost-${{ env.BOOST_VERSION }}.tar.gz
dist/ofxiOSBoost-${{ env.BOOST_VERSION }}.tar.gz.sha256
dist/ofxiOSBoost.podspec
dist/ofxiOSBoost-${{ env.BOOST_VERSION }}-xcframework.zip
dist/ofxiOSBoost-${{ env.BOOST_VERSION }}-xcframework.zip.sha256
if-no-files-found: error
- name: Create or update GitHub Release
if: github.event_name == 'workflow_dispatch' || github.ref_type == 'tag'
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ env.BOOST_VERSION }}
run: |
notes="$RUNNER_TEMP/release-notes.md"
bash ./scripts/generate-release-notes.sh "$BOOST_VERSION" "$notes"
if ! gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
gh release create "$RELEASE_TAG" \
--target "$GITHUB_SHA" \
--title "Boost ${BOOST_VERSION} for iOS" \
--notes-file "$notes"
fi
gh release edit "$RELEASE_TAG" \
--title "Boost ${BOOST_VERSION} for iOS" \
--notes-file "$notes"
gh release upload "$RELEASE_TAG" \
"dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz" \
"dist/ofxiOSBoost-${BOOST_VERSION}.tar.gz.sha256" \
"dist/ofxiOSBoost.podspec" \
"dist/ofxiOSBoost-${BOOST_VERSION}-xcframework.zip" \
"dist/ofxiOSBoost-${BOOST_VERSION}-xcframework.zip.sha256" \
--clobber
- name: Validate published CocoaPods source
if: github.event_name == 'workflow_dispatch' || github.ref_type == 'tag'
run: |
log="$RUNNER_TEMP/cocoapods-spec-lint.log"
if ! pod spec lint "dist/ofxiOSBoost.podspec" \
--platforms=ios >"$log" 2>&1; then
tail -n 200 "$log"
exit 1
fi
echo "Validated the published CocoaPods source."
- name: Publish CocoaPods release
if: github.event_name == 'workflow_dispatch' || github.ref_type == 'tag'
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
if [[ -z "$COCOAPODS_TRUNK_TOKEN" ]]; then
echo "COCOAPODS_TRUNK_TOKEN is not configured; skipping CocoaPods Trunk publication."
exit 0
fi
log="$RUNNER_TEMP/cocoapods-trunk-push.log"
for attempt in 1 2 3; do
if pod trunk info ofxiOSBoost 2>/dev/null | grep -Fq -- "- ${BOOST_VERSION} ("; then
echo "ofxiOSBoost ${BOOST_VERSION} is already published to CocoaPods Trunk."
exit 0
fi
if pod trunk push "dist/ofxiOSBoost.podspec" >"$log" 2>&1; then
echo "Published ofxiOSBoost ${BOOST_VERSION} to CocoaPods Trunk."
exit 0
fi
if [[ "$attempt" -lt 3 ]]; then
echo "CocoaPods publication attempt ${attempt} failed; retrying."
sleep 10
fi
done
tail -n 80 "$log"
exit 1