Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

some final windows fixes (#329)

Brendan Allanfd58de4d4807
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 96cce254f..edef5bd82 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -6,6 +6,10 @@ on:
pull_request:
workflow_dispatch:
+concurrency:
+ group: ${{ github.head_ref || github.ref_name }}
+ cancel-in-progress: true
+
jobs:
typecheck:
name: Typecheck
@@ -33,21 +37,38 @@ jobs:
clippy:
name: Clippy
- runs-on: ubuntu-latest
+ runs-on: macos-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- - uses: ./.github/actions/setup-js
+ - name: Rust setup
+ uses: dtolnay/rust-toolchain@stable
+ with:
+ targets: ${{ matrix.settings.target }}
+
+ - name: Rust cache
+ uses: swatinem/rust-cache@v2
+ with:
+ shared-key: ${{ matrix.settings.target }}
- - uses: ./.github/actions/setup-rust
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
with:
- target: x86_64-unknown-linux-gnu
+ version: 9.8.0
- - name: Install desktop deps
- uses: ./.github/actions/install-desktop-deps
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "20"
+ cache: pnpm
+
+ - name: Run setup
+ run: |
+ touch .env
+ pnpm cap-setup
- name: Run Clippy
uses: actions-rs-plus/clippy-check@v2
@@ -62,10 +83,8 @@ jobs:
settings:
- target: aarch64-apple-darwin
runner: macos-latest
- arch: aarch64
- target: x86_64-pc-windows-msvc
runner: windows-latest
- arch: x86_64
runs-on: ${{ matrix.settings.runner }}
steps:
- name: Checkout repository
@@ -120,8 +139,8 @@ jobs:
working-directory: apps/desktop
run: |
pnpm -w cap-setup
- pnpm tauri build --debug
+ pnpm tauri build --debug --target ${{ matrix.settings.target }}
env:
# https://github.com/tauri-apps/tauri-action/issues/740
CI: false
- RUST_ARCH: ${{ matrix.settings.arch }}
+ RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 44c14a713..78ee7f352 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -138,13 +138,10 @@ jobs:
settings:
- target: x86_64-apple-darwin
runner: macos-latest
- arch: x86_64
- target: aarch64-apple-darwin
runner: macos-latest
- arch: aarch64
- target: x86_64-pc-windows-msvc
runner: windows-latest
- arch: x86_64
runs-on: ${{ matrix.settings.runner }}
steps:
- name: Checkout repository
@@ -201,6 +198,7 @@ jobs:
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
+ echo 'RUST_TARGET_TRIPLE=${{ matrix.settings.target }}' >> .env
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env
@@ -228,7 +226,6 @@ jobs:
APPLE_KEYCHAIN: ${{ runner.temp }}/build.keychain
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- RUST_ARCH: ${{ matrix.settings.arch }}
- name: Upload assets
uses: crabnebula-dev/cloud-release@v0
diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json
index dc15c2324..2b7aaa160 100644
--- a/apps/desktop/src-tauri/tauri.conf.json
+++ b/apps/desktop/src-tauri/tauri.conf.json
@@ -43,13 +43,13 @@
"icons/macos/icon.icns",
"icons/icon.ico"
],
- "resources": [
- "assets/backgrounds/macOS/*",
- "assets/backgrounds/blue/*",
- "assets/backgrounds/dark/*",
- "assets/backgrounds/orange/*",
- "assets/backgrounds/purple/*"
- ],
+ "resources": {
+ "assets/backgrounds/macOS/*": "assets/backgrounds/macOS/",
+ "assets/backgrounds/blue/*": "assets/backgrounds/blue/",
+ "assets/backgrounds/dark/*": "assets/backgrounds/dark/",
+ "assets/backgrounds/orange/*": "assets/backgrounds/orange/",
+ "assets/backgrounds/purple/*": "assets/backgrounds/purple/"
+ },
"macOS": {
"dmg": {
"background": "assets/dmg-background.png",
diff --git a/apps/desktop/src/utils/queries.ts b/apps/desktop/src/utils/queries.ts
index 8e1aa182b..886a032fc 100644
--- a/apps/desktop/src/utils/queries.ts
+++ b/apps/desktop/src/utils/queries.ts
@@ -95,11 +95,6 @@ export function createOptionsQuery() {
createStore<PartialRecordingOptions>({
cameraLabel: null,
audioInputName: null,
- fps: FPS,
- outputResolution: {
- width: 1920,
- height: 1080,
- },
}),
{ name: "recordingOptionsQuery" }
);
diff --git a/crates/rendering/src/project_recordings.rs b/crates/rendering/src/project_recordings.rs
index ab67837a4..812f2b8bb 100644
--- a/crates/rendering/src/project_recordings.rs
+++ b/crates/rendering/src/project_recordings.rs
@@ -81,8 +81,7 @@ impl ProjectRecordings {
let display = Video::new(&meta.path(&segment.display.path))
.expect("Failed to read display video");
let camera = segment.camera.as_ref().map(|camera| {
- Video::new(&meta.path(&camera.path))
- .expect("Failed to read camera video")
+ Video::new(&meta.path(&camera.path)).expect("Failed to read camera video")
});
let audio = segment
.audio
@@ -102,8 +101,7 @@ impl ProjectRecordings {
let display = Video::new(&meta.path(&s.display.path))
.expect("Failed to read display video");
let camera = s.camera.as_ref().map(|camera| {
- Video::new(&meta.path(&camera.path))
- .expect("Failed to read camera video")
+ Video::new(&meta.path(&camera.path)).expect("Failed to read camera video")
});
let audio = s
.audio
diff --git a/package.json b/package.json
index 1a6411113..b0f02bd6b 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"docker:up": "turbo run docker:up",
"docker:stop": "turbo run docker:stop",
"docker:clean": "turbo run docker:clean",
- "cap-setup": "node scripts/setup.js"
+ "cap-setup": "node --env-file .env scripts/setup.js"
},
"devDependencies": {
"@turbo/gen": "^1.9.7",
diff --git a/scripts/setup.js b/scripts/setup.js
index 4e277a290..3136b6855 100644
--- a/scripts/setup.js
+++ b/scripts/setup.js
@@ -15,7 +15,8 @@ const __root = path.resolve(path.join(__dirname, ".."));
const targetDir = path.join(__root, "target");
const arch =
- process.env.RUST_ARCH ?? process.arch === "arm64" ? "aarch64" : "x86_64";
+ process.env.RUST_TARGET_TRIPLE?.split("-")[0] ??
+ (process.arch === "arm64" ? "aarch64" : "x86_64");
async function main() {
await fs.mkdir(targetDir, { recursive: true });
@@ -29,15 +30,13 @@ async function main() {
aarch64: "native-deps-aarch64-darwin-apple.tar.xz",
};
- const nativeDepsTar = `native-deps-${NATIVE_DEPS_VERSION}.tar.xz`;
+ const nativeDepsTar = NATIVE_DEPS_ASSETS[arch];
const nativeDepsTarPath = path.join(targetDir, nativeDepsTar);
let downloadedNativeDeps = false;
if (!(await fileExists(nativeDepsTarPath))) {
console.log(`Downloading ${nativeDepsTar}`);
- const nativeDepsBytes = await fetch(
- `${NATIVE_DEPS_URL}/${NATIVE_DEPS_ASSETS[arch]}`
- )
+ const nativeDepsBytes = await fetch(`${NATIVE_DEPS_URL}/${nativeDepsTar}`)
.then((r) => r.blob())
.then((b) => b.arrayBuffer());
await fs.writeFile(nativeDepsTarPath, Buffer.from(nativeDepsBytes));