mirror of
https://github.com/D-Modem/app.git
synced 2026-11-28 17:38:05 -08:00
nightly.yml takes the artifacts of the newest commit on main that has a complete run of android.yml and apple.yml, and replaces the "nightly" pre-release with them. It stops when main has no new commits. A hung test does not stop it: the release APK comes from the release job, which runs no tests, and the release lists each file that is missing. apple.yml now also builds the iOS app for a device, not signed, on main (DModem-unsigned.ipa). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B82eRR6tKgobV4RbMTv4eL
109 lines
4.2 KiB
YAML
109 lines
4.2 KiB
YAML
# The modem for Apple's systems, and the Kotlin the apps share on iOS: the engine with D-Modem, libre and
|
|
# Mbed TLS built for iOS (devices and simulator) and macOS as an
|
|
# XCFramework (ios/build-native.sh), and its Swift tests run on macOS
|
|
# (ios/DModemSmoke): the modem through its C API, as the iOS app has it;
|
|
# DModemKit's tests, and the iOS app (ios/DModem) built for the simulator;
|
|
# on main, also for a device, not signed (DModem-unsigned.ipa).
|
|
#
|
|
# D-Modem is a private submodule: the DMODEM_TOKEN secret (as
|
|
# android.yml's).
|
|
name: Apple
|
|
|
|
# (a branch's commits run once, as its pull request: pushed, only main's;
|
|
# a change to docs alone runs nothing: the Markdown, docs/ and COPYING)
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths: ['**', '!**.md', '!docs/**', '!COPYING', '!mkdocs.yml', '!.github/workflows/pages.yml', '!tools/settings_ref.py']
|
|
pull_request:
|
|
paths: ['**', '!**.md', '!docs/**', '!COPYING', '!mkdocs.yml', '!.github/workflows/pages.yml', '!tools/settings_ref.py']
|
|
workflow_dispatch:
|
|
|
|
# a newer commit on a pull request cancels the run before it (main's all run)
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
|
|
jobs:
|
|
engine:
|
|
runs-on: macos-latest
|
|
# (a hung test ends here, not at GitHub's 6 hours)
|
|
timeout-minutes: 50
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
submodules: recursive
|
|
token: ${{ secrets.DMODEM_TOKEN || github.token }}
|
|
|
|
# (Homebrew's downloads cached: .github/actions/brew)
|
|
- name: Ninja, XcodeGen
|
|
uses: ./.github/actions/brew
|
|
with:
|
|
packages: ninja xcodegen
|
|
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
distribution: temurin
|
|
java-version: "21"
|
|
|
|
- uses: gradle/actions/setup-gradle@v5
|
|
|
|
# the Kotlin the apps share (shared/): its common tests on an iOS
|
|
# simulator, its framework built
|
|
- name: Shared Kotlin on iOS
|
|
run: ./gradlew :shared:iosSimulatorArm64Test :shared:linkDebugFrameworkIosArm64
|
|
|
|
- name: Build the XCFramework
|
|
run: ios/build-native.sh
|
|
|
|
- name: Swift tests (macOS)
|
|
run: swift test --package-path ios/DModemSmoke
|
|
|
|
- name: DModemKit's tests (macOS)
|
|
run: swift test --package-path ios/DModemKit
|
|
|
|
# the iOS app: its project from ios/DModem/project.yml, built for the simulator
|
|
- name: The shared Kotlin as an XCFramework
|
|
run: ./gradlew :shared:assembleDModemSharedReleaseXCFramework
|
|
|
|
# arm64 only: the shared Kotlin's XCFramework has no x86_64 simulator slice
|
|
- name: The iOS app (simulator)
|
|
run: |
|
|
cd ios/DModem && xcodegen generate
|
|
xcodebuild -project DModem.xcodeproj -scheme DModem \
|
|
-destination 'generic/platform=iOS Simulator' \
|
|
ARCHS=arm64 CODE_SIGNING_ALLOWED=NO build
|
|
|
|
# the iOS app for a device, not signed, as an .ipa (for the nightly
|
|
# release, nightly.yml): main and a manual run only, not a pull request.
|
|
# A person signs it again for their device (for example with AltStore
|
|
# or Sideloadly).
|
|
- name: The iOS app (device, not signed)
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
cd ios/DModem
|
|
xcodebuild -project DModem.xcodeproj -scheme DModem -configuration Release \
|
|
-destination 'generic/platform=iOS' -derivedDataPath "$RUNNER_TEMP/ios-device" \
|
|
CODE_SIGNING_ALLOWED=NO build
|
|
mkdir -p "$RUNNER_TEMP/ipa/Payload"
|
|
cp -R "$RUNNER_TEMP/ios-device/Build/Products/Release-iphoneos/DModem.app" "$RUNNER_TEMP/ipa/Payload/"
|
|
(cd "$RUNNER_TEMP/ipa" && zip -qry "$GITHUB_WORKSPACE/DModem-unsigned.ipa" Payload)
|
|
|
|
# (the .ipa itself, not zipped: as android.yml's APK)
|
|
- uses: actions/upload-artifact@v7
|
|
if: github.event_name != 'pull_request'
|
|
with:
|
|
path: DModem-unsigned.ipa
|
|
archive: false
|
|
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: DModemEngine.xcframework
|
|
path: build-apple/DModemEngine.xcframework
|
|
|
|
- uses: actions/upload-artifact@v7
|
|
if: failure()
|
|
with:
|
|
name: build-logs
|
|
path: build-apple/**/_deps/*.log
|