diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..50234c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: CI + +on: + pull_request: + push: + branches: [master] + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docc: + name: DocC catalog + runs-on: macos-15 + timeout-minutes: 30 + steps: + - uses: actions/checkout@v4 + + - name: Select Xcode + run: | + if [ ! -d /Applications/Xcode_16.4.app ]; then + echo "Xcode 16.4 not found. Installed Xcode versions:" + ls /Applications | grep Xcode || true + exit 1 + fi + sudo xcode-select -s /Applications/Xcode_16.4.app/Contents/Developer + + - name: Verify Swift version + run: swift --version + + - name: Build DocC catalog + run: | + swift package --allow-writing-to-directory ./docc-output \ + generate-documentation --target ReliaBLE --warnings-as-errors \ + --output-path ./docc-output + + - name: Archive DocC output + run: ditto -c -k --sequesterRsrc --keepParent docc-output ReliaBLE-docs.zip + + - name: Upload DocC archive + uses: actions/upload-artifact@v4 + with: + name: ReliaBLE-docs + path: ReliaBLE-docs.zip + if-no-files-found: error \ No newline at end of file diff --git a/.gitignore b/.gitignore index acd741b..70a8d53 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ Packages/ .swiftpm .build/ +docc-output/ DerivedData/ # CocoaPods diff --git a/Sources/ReliaBLE/Models/Peripheral.swift b/Sources/ReliaBLE/Models/Peripheral.swift index 650a5c7..ede255d 100644 --- a/Sources/ReliaBLE/Models/Peripheral.swift +++ b/Sources/ReliaBLE/Models/Peripheral.swift @@ -66,10 +66,10 @@ public class Peripheral: Identifiable, Hashable { /// The timestamp when the peripheral was last seen public internal(set) var lastSeen: Date? - /// Create a peripheral with a unique identifier and optional CoreBluetooth peripheral data. The integrating app - /// should use this initializer to create a `Peripheral` instance when it has a unique identifier for a peripheral - /// but has not yet discovered the peripheral with CoreBluetooth. The ``PeripheralManager`` will update the instance - /// with CoreBluetooth data when the peripheral is discovered. + /// Creates a peripheral with a unique identifier and optional CoreBluetooth discovery data. + /// + /// Prefer observing ``ReliaBLEManager/discoveredPeripherals`` for devices discovered during scanning. + /// ReliaBLE updates only the ``Peripheral`` instances it manages internally and emits through that publisher. /// - Parameters: /// - id: Unique identifier for the peripheral as set by the integrating app. /// - peripheral: Reference to the CoreBluetooth `CBPeripheral` object