Skip to content

Commit dddf63c

Browse files
committed
Fixup liblsl and CI documentation
1 parent b89c480 commit dddf63c

File tree

2 files changed

+34
-46
lines changed

2 files changed

+34
-46
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ jobs:
163163
env:
164164
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
165165
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
166-
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
167166
run: |
168-
# Create temporary keychain
167+
# Create temporary keychain with random password
169168
KEYCHAIN_PATH=$RUNNER_TEMP/build.keychain
169+
MACOS_CI_KEYCHAIN_PWD=$(openssl rand -base64 32)
170170
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" $KEYCHAIN_PATH
171171
security default-keychain -s $KEYCHAIN_PATH
172172
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH

README.md

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This is the reference template for building Lab Streaming Layer (LSL) applicatio
55
## Features
66

77
- **Modern CMake** (3.28+) with clean, documented structure
8-
- **4-tier liblsl discovery**: source, install_root, system, FetchContent
8+
- **Automatic liblsl**: fetched via FetchContent, or use a pre-installed version
99
- **CLI and GUI separation** with shared core library
1010
- **Qt6** for the GUI (with Qt5 intentionally dropped for simplicity)
1111
- **Cross-platform**: Linux, macOS, Windows
@@ -96,23 +96,20 @@ cd build && cpack
9696

9797
### Build Options
9898

99-
| Option | Default | Description |
100-
|--------|---------|-------------|
101-
| `LSLTEMPLATE_BUILD_GUI` | ON | Build the GUI application |
102-
| `LSLTEMPLATE_BUILD_CLI` | ON | Build the CLI application |
103-
| `LSL_FETCH_IF_MISSING` | ON | Auto-fetch liblsl from GitHub |
104-
| `LSL_FETCH_REF` | (see CMakeLists.txt) | liblsl git ref to fetch (tag, branch, or commit) |
105-
| `LSL_SOURCE_DIR` | - | Path to liblsl source (for development) |
106-
| `LSL_INSTALL_ROOT` | - | Path to installed liblsl |
99+
| Option | Default | Description |
100+
|-------------------------|----------------------|--------------------------------------------------|
101+
| `LSLTEMPLATE_BUILD_GUI` | ON | Build the GUI application |
102+
| `LSLTEMPLATE_BUILD_CLI` | ON | Build the CLI application |
103+
| `LSL_INSTALL_ROOT` | - | Path to installed liblsl (skips FetchContent) |
104+
| `LSL_FETCH_REF` | (see CMakeLists.txt) | liblsl git ref to fetch (tag, branch, or commit) |
107105

108-
### liblsl Discovery Priority
106+
### liblsl Discovery
109107

110-
The build system searches for liblsl in this order:
108+
By default, liblsl is fetched automatically from GitHub using CMake's FetchContent. To use a pre-installed liblsl instead, set `LSL_INSTALL_ROOT`:
111109

112-
1. **LSL_SOURCE_DIR** - Build from local source (for parallel liblsl development)
113-
2. **LSL_INSTALL_ROOT** - Explicit installation path
114-
3. **System** - Standard CMake search paths
115-
4. **FetchContent** - Automatic download from GitHub
110+
```bash
111+
cmake -S . -B build -DLSL_INSTALL_ROOT=/path/to/liblsl
112+
```
116113

117114
### CLI-Only Build
118115

@@ -123,13 +120,9 @@ cmake -S . -B build -DLSLTEMPLATE_BUILD_GUI=OFF
123120
cmake --build build
124121
```
125122

126-
### Building with Local liblsl
123+
### Parallel Development with liblsl
127124

128-
For parallel development with liblsl:
129-
130-
```bash
131-
cmake -S . -B build -DLSL_SOURCE_DIR=/path/to/liblsl
132-
```
125+
If you need to develop against a local liblsl source tree (e.g., testing liblsl changes alongside your app), see [App-LabRecorder](https://github.com/labstreaminglayer/App-LabRecorder/) for an example of a more advanced liblsl discovery setup that supports `LSL_SOURCE_DIR`.
133126

134127
## Usage
135128

@@ -158,36 +151,31 @@ cmake -S . -B build -DLSL_SOURCE_DIR=/path/to/liblsl
158151

159152
## macOS Code Signing
160153

161-
For local development, the build automatically applies ad-hoc signing with network entitlements. This allows the app to use LSL's multicast discovery.
154+
For local development, the build automatically applies ad-hoc signing with network entitlements, allowing the app to use LSL's multicast discovery.
162155

163-
For distribution, use the signing script:
156+
For distribution, apps must be signed with a Developer ID certificate and notarized. See `scripts/sign_and_notarize.sh` and Apple's [Notarizing macOS Software Before Distribution](https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution) guide.
164157

165-
```bash
166-
# Sign only
167-
./scripts/sign_and_notarize.sh build/install/LSLTemplate.app
158+
The GitHub Actions workflow handles signing and notarization automatically using organization secrets:
168159

169-
# Sign and notarize
170-
export APPLE_CODE_SIGN_IDENTITY_APP="Developer ID Application: Your Name"
171-
export APPLE_NOTARIZE_KEYCHAIN_PROFILE="your-profile"
172-
./scripts/sign_and_notarize.sh build/install/LSLTemplate.app --notarize
173-
```
160+
| Secret | Description |
161+
|------------------------------------|------------------------------------------------------------|
162+
| `PROD_MACOS_CERTIFICATE` | Base64-encoded Developer ID Application certificate (.p12) |
163+
| `PROD_MACOS_CERTIFICATE_PWD` | Certificate password |
164+
| `PROD_MACOS_NOTARIZATION_APPLE_ID` | Apple ID email for notarization |
165+
| `PROD_MACOS_NOTARIZATION_PWD` | Apple ID App-specific password for the notary tool |
166+
| `PROD_MACOS_NOTARIZATION_TEAM_ID` | Apple Developer Team ID |
174167

175-
## GitHub Actions Secrets
168+
These secrets must be shared with your repository under Organization Settings → Secrets and variables → Actions → Repository access.
176169

177-
For automated signing and notarization, the workflow expects these secrets from the `labstreaminglayer` organization:
170+
The GHA workflow imports the certificate and stores notarization credentials, then sets environment variables for `sign_and_notarize.sh`:
178171

179-
| Secret | Description |
180-
|--------|-------------|
181-
| `PROD_MACOS_CERTIFICATE` | Base64-encoded Developer ID Application certificate (.p12) |
182-
| `PROD_MACOS_CERTIFICATE_PWD` | Certificate password |
183-
| `PROD_MACOS_CI_KEYCHAIN_PWD` | Password for temporary CI keychain |
184-
| `PROD_MACOS_NOTARIZATION_APPLE_ID` | Apple ID email for notarization |
185-
| `PROD_MACOS_NOTARIZATION_PWD` | App-specific password for Apple ID |
186-
| `PROD_MACOS_NOTARIZATION_TEAM_ID` | Apple Developer Team ID |
172+
| Script Environment Variable | Source |
173+
|------------------------------------|----------------------------------------------------------------------------------------|
174+
| `APPLE_CODE_SIGN_IDENTITY_APP` | Extracted from imported certificate (e.g., `Developer ID Application: Name (TEAMID)`) |
175+
| `APPLE_NOTARIZE_KEYCHAIN_PROFILE` | Created via `notarytool store-credentials` using the three `NOTARIZATION` secrets |
176+
| `ENTITLEMENTS_FILE` | Set to `app.entitlements` in the repo |
187177

188-
**Important:** These organization secrets must be shared with your repository. In GitHub:
189-
1. Go to Organization Settings → Secrets and variables → Actions
190-
2. For each secret, click to edit and under "Repository access" select the repositories that need access
178+
To run the script locally, install your Developer ID certificate in Keychain, create a notarization profile with `xcrun notarytool store-credentials`, and set these environment variables.
191179

192180
## License
193181

0 commit comments

Comments
 (0)