Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: build .pkg for macOS Intune/MDM deployment

Louis Beaumontc06caf8c1c56
diff --git a/.github/workflows/release-enterprise.yml b/.github/workflows/release-enterprise.yml
index 26ac3fb38..8e26aaeb5 100644
--- a/.github/workflows/release-enterprise.yml
+++ b/.github/workflows/release-enterprise.yml
@@ -519,6 +519,70 @@ jobs:
fi
done
+ - name: Build .pkg for Intune/MDM deployment
+ shell: bash
+ env:
+ APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
+ APPLE_ID: ${{ secrets.APPLE_ID }}
+ APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
+ APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
+ run: |
+ TARGET="aarch64-apple-darwin"
+ BUNDLE_DIR="apps/screenpipe-app-tauri/src-tauri/target/${TARGET}/release/bundle"
+ VERSION=$(grep '^version = ' apps/screenpipe-app-tauri/src-tauri/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
+
+ APP_PATH="${BUNDLE_DIR}/macos/screenpipe.app"
+ if [ ! -d "$APP_PATH" ]; then
+ echo "Looking for .app bundle..."
+ APP_PATH=$(find "${BUNDLE_DIR}" -name "*.app" -maxdepth 2 | head -1)
+ fi
+
+ if [ -z "$APP_PATH" ] || [ ! -d "$APP_PATH" ]; then
+ echo "WARNING: No .app bundle found, skipping .pkg creation"
+ exit 0
+ fi
+
+ echo "Building .pkg from $APP_PATH"
+
+ PKG_DIR="${BUNDLE_DIR}/pkg"
+ mkdir -p "$PKG_DIR"
+
+ # Create component pkg — installs to /Applications
+ COMPONENT_PKG="${PKG_DIR}/screenpipe-component.pkg"
+ pkgbuild \
+ --root "$(dirname "$APP_PATH")" \
+ --install-location /Applications \
+ --identifier "screenpi.pe.enterprise" \
+ --version "$VERSION" \
+ --component-plist /dev/null \
+ "$COMPONENT_PKG"
+
+ echo "Component pkg created"
+
+ # Create distribution pkg (what Intune deploys)
+ PKG_OUTPUT="${PKG_DIR}/screenpipe-enterprise-${VERSION}-arm64.pkg"
+ productbuild \
+ --package "$COMPONENT_PKG" \
+ --identifier "screenpi.pe.enterprise.installer" \
+ --version "$VERSION" \
+ "$PKG_OUTPUT"
+
+ echo "Distribution pkg created: $(basename "$PKG_OUTPUT")"
+ rm -f "$COMPONENT_PKG"
+
+ # Notarize the .pkg
+ echo "Notarizing .pkg..."
+ xcrun notarytool submit "$PKG_OUTPUT" \
+ --apple-id "$APPLE_ID" \
+ --password "$APPLE_PASSWORD" \
+ --team-id "$APPLE_TEAM_ID" \
+ --wait --timeout 15m
+
+ echo "Stapling .pkg..."
+ xcrun stapler staple "$PKG_OUTPUT"
+ xcrun stapler validate "$PKG_OUTPUT"
+ echo ".pkg notarized and stapled: $(basename "$PKG_OUTPUT")"
+
- name: Upload to R2
shell: bash
env:
@@ -536,14 +600,18 @@ jobs:
for dmg in "${BUNDLE_DIR}"/dmg/*.dmg; do
[ -f "$dmg" ] && aws s3 cp "$dmg" "${R2_PREFIX}/$(basename "$dmg")" --endpoint-url "$R2_ENDPOINT" && echo " $(basename "$dmg")"
done
+ for pkg in "${BUNDLE_DIR}"/pkg/*.pkg; do
+ [ -f "$pkg" ] && aws s3 cp "$pkg" "${R2_PREFIX}/$(basename "$pkg")" --endpoint-url "$R2_ENDPOINT" && echo " $(basename "$pkg")"
+ done
echo "R2 enterprise upload complete for macOS"
- - name: Upload enterprise DMG (artifact)
+ - name: Upload enterprise macOS artifacts
uses: actions/upload-artifact@v4
with:
name: enterprise-macos-arm64
path: |
apps/screenpipe-app-tauri/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
+ apps/screenpipe-app-tauri/src-tauri/target/aarch64-apple-darwin/release/bundle/pkg/*.pkg
# ─── Notify subscribers after all builds complete ─────────────────────────
notify: