Skip to content

Commit

Permalink
Attempt to build both targets
Browse files Browse the repository at this point in the history
  • Loading branch information
karaggeorge committed Nov 16, 2024
1 parent 90d3b0f commit 125c0a8
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 10 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
pull_request:

jobs:
build-arm:
runs-on: macos-15
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build arm artifact
run: npm run build:module:arm
- name: Upload arm artifact
uses: actions/upload-artifact@v3
with:
name: arm-artifact
path: aperture-arm.node

build-x86:
runs-on: macos-15-large
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build x86 artifact
run: npm run build:module:x86
- name: Upload arm artifact
uses: actions/upload-artifact@v3
with:
name: x86-artifact
path: aperture-x86.node
2 changes: 1 addition & 1 deletion Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"location" : "https://github.com/wulkano/Aperture",
"state" : {
"branch" : "george/rewrite-in-screen-capture-kit",
"revision" : "6a3adffa8b3af3fd766e581bddf2c4416bf4547a"
"revision" : "eaaee3b550c23b86e0df39ae3261d0024923ecfd"
}
},
{
Expand Down
6 changes: 4 additions & 2 deletions Sources/ApertureCLI/record.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ func record(_ optionsString: String, processId: String, targetType: TargetType)

observers.append(
ApertureEvents.answerEvent(processId: processId, event: InEvent.pause.rawValue) { _ in
recorder.pause()
try? recorder.pause()
}
)

observers.append(
ApertureEvents.answerEvent(processId: processId, event: InEvent.resume.rawValue) { _ in
recorder.resume()
Task {
try? await recorder.resume()
}
}
)

Expand Down
8 changes: 4 additions & 4 deletions Sources/ApertureModule/ApertureModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ import AVFoundation

@NodeActor
@NodeMethod
func pause() {
self.recorder.pause()
func pause() throws {
try self.recorder.pause()
}

@NodeActor
@NodeMethod
func resume() {
self.recorder.resume()
func resume() async throws {
try await self.recorder.resume()
}

@NodeActor
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aperture",
"version": "7.0.0",
"version": "8.0.0",
"description": "Record the screen on macOS",
"license": "MIT",
"repository": "wulkano/aperture-node",
Expand All @@ -25,9 +25,11 @@
"build:cli": "npm run build:cli:build && npm run build:cli:move",
"build:cli:build": "swift build --configuration=release --product aperture --arch arm64 --arch x86_64",
"build:cli:move": "mv .build/apple/Products/Release/aperture .",
"build:module": "npm run build:module:build && npm run build:module:move && npm run build:module:sign",
"build:module:arm": "npm run build:module:build && npm run build:module:move:arm && npm run build:module:sign",
"build:module:x86": "npm run build:module:build && npm run build:module:move:x86 && npm run build:module:sign",
"build:module:build": "swift build -c release --product aperture-module -Xlinker -undefined -Xlinker dynamic_lookup",
"build:module:move": "mv .build/arm64-apple-macosx/release/libaperture-module.dylib ./aperture.node",
"build:module:move:arm": "mv .build/arm64-apple-macosx/release/libaperture-module.dylib ./aperture-arm.node",
"build:module:move:x86": "ls .build && mv .build/x86_64-apple-macosx/release/libaperture-module.dylib ./aperture-x86.node",
"build:module:sign": "codesign -fs - ./aperture.node",
"prepublish": "npm run build"
},
Expand Down

0 comments on commit 125c0a8

Please sign in to comment.