Skip to content

Commit fd58de4

Browse files
authored
some final windows fixes (#329)
* use rust target * move RUST_TARGET_TRIPLE * bruh * load env file * remove log * fix * resources map * ts + fmt * clippy on macos * bruh * gdi * env * cancel in progress
1 parent 29ffbc1 commit fd58de4

File tree

7 files changed

+44
-36
lines changed

7 files changed

+44
-36
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
workflow_dispatch:
88

9+
concurrency:
10+
group: ${{ github.head_ref || github.ref_name }}
11+
cancel-in-progress: true
12+
913
jobs:
1014
typecheck:
1115
name: Typecheck
@@ -33,21 +37,38 @@ jobs:
3337

3438
clippy:
3539
name: Clippy
36-
runs-on: ubuntu-latest
40+
runs-on: macos-latest
3741
permissions:
3842
contents: read
3943
steps:
4044
- name: Checkout repository
4145
uses: actions/checkout@v4
4246

43-
- uses: ./.github/actions/setup-js
47+
- name: Rust setup
48+
uses: dtolnay/rust-toolchain@stable
49+
with:
50+
targets: ${{ matrix.settings.target }}
51+
52+
- name: Rust cache
53+
uses: swatinem/rust-cache@v2
54+
with:
55+
shared-key: ${{ matrix.settings.target }}
4456

45-
- uses: ./.github/actions/setup-rust
57+
- name: Setup pnpm
58+
uses: pnpm/action-setup@v4
4659
with:
47-
target: x86_64-unknown-linux-gnu
60+
version: 9.8.0
4861

49-
- name: Install desktop deps
50-
uses: ./.github/actions/install-desktop-deps
62+
- name: Setup Node.js
63+
uses: actions/setup-node@v4
64+
with:
65+
node-version: "20"
66+
cache: pnpm
67+
68+
- name: Run setup
69+
run: |
70+
touch .env
71+
pnpm cap-setup
5172
5273
- name: Run Clippy
5374
uses: actions-rs-plus/clippy-check@v2
@@ -62,10 +83,8 @@ jobs:
6283
settings:
6384
- target: aarch64-apple-darwin
6485
runner: macos-latest
65-
arch: aarch64
6686
- target: x86_64-pc-windows-msvc
6787
runner: windows-latest
68-
arch: x86_64
6988
runs-on: ${{ matrix.settings.runner }}
7089
steps:
7190
- name: Checkout repository
@@ -120,8 +139,8 @@ jobs:
120139
working-directory: apps/desktop
121140
run: |
122141
pnpm -w cap-setup
123-
pnpm tauri build --debug
142+
pnpm tauri build --debug --target ${{ matrix.settings.target }}
124143
env:
125144
# https://github.com/tauri-apps/tauri-action/issues/740
126145
CI: false
127-
RUST_ARCH: ${{ matrix.settings.arch }}
146+
RUST_TARGET_TRIPLE: ${{ matrix.settings.target }}

.github/workflows/publish.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,10 @@ jobs:
138138
settings:
139139
- target: x86_64-apple-darwin
140140
runner: macos-latest
141-
arch: x86_64
142141
- target: aarch64-apple-darwin
143142
runner: macos-latest
144-
arch: aarch64
145143
- target: x86_64-pc-windows-msvc
146144
runner: windows-latest
147-
arch: x86_64
148145
runs-on: ${{ matrix.settings.runner }}
149146
steps:
150147
- name: Checkout repository
@@ -201,6 +198,7 @@ jobs:
201198
echo 'VITE_SERVER_URL=${{ secrets.NEXT_PUBLIC_WEB_URL }}' >> .env
202199
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
203200
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
201+
echo 'RUST_TARGET_TRIPLE=${{ matrix.settings.target }}' >> .env
204202
205203
- name: Copy .env to apps/desktop
206204
run: cp .env apps/desktop/.env
@@ -228,7 +226,6 @@ jobs:
228226
APPLE_KEYCHAIN: ${{ runner.temp }}/build.keychain
229227
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
230228
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
231-
RUST_ARCH: ${{ matrix.settings.arch }}
232229

233230
- name: Upload assets
234231
uses: crabnebula-dev/cloud-release@v0

apps/desktop/src-tauri/tauri.conf.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
"icons/macos/icon.icns",
4444
"icons/icon.ico"
4545
],
46-
"resources": [
47-
"assets/backgrounds/macOS/*",
48-
"assets/backgrounds/blue/*",
49-
"assets/backgrounds/dark/*",
50-
"assets/backgrounds/orange/*",
51-
"assets/backgrounds/purple/*"
52-
],
46+
"resources": {
47+
"assets/backgrounds/macOS/*": "assets/backgrounds/macOS/",
48+
"assets/backgrounds/blue/*": "assets/backgrounds/blue/",
49+
"assets/backgrounds/dark/*": "assets/backgrounds/dark/",
50+
"assets/backgrounds/orange/*": "assets/backgrounds/orange/",
51+
"assets/backgrounds/purple/*": "assets/backgrounds/purple/"
52+
},
5353
"macOS": {
5454
"dmg": {
5555
"background": "assets/dmg-background.png",

apps/desktop/src/utils/queries.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ export function createOptionsQuery() {
9595
createStore<PartialRecordingOptions>({
9696
cameraLabel: null,
9797
audioInputName: null,
98-
fps: FPS,
99-
outputResolution: {
100-
width: 1920,
101-
height: 1080,
102-
},
10398
}),
10499
{ name: "recordingOptionsQuery" }
105100
);

crates/rendering/src/project_recordings.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ impl ProjectRecordings {
8181
let display = Video::new(&meta.path(&segment.display.path))
8282
.expect("Failed to read display video");
8383
let camera = segment.camera.as_ref().map(|camera| {
84-
Video::new(&meta.path(&camera.path))
85-
.expect("Failed to read camera video")
84+
Video::new(&meta.path(&camera.path)).expect("Failed to read camera video")
8685
});
8786
let audio = segment
8887
.audio
@@ -102,8 +101,7 @@ impl ProjectRecordings {
102101
let display = Video::new(&meta.path(&s.display.path))
103102
.expect("Failed to read display video");
104103
let camera = s.camera.as_ref().map(|camera| {
105-
Video::new(&meta.path(&camera.path))
106-
.expect("Failed to read camera video")
104+
Video::new(&meta.path(&camera.path)).expect("Failed to read camera video")
107105
});
108106
let audio = s
109107
.audio

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"docker:up": "turbo run docker:up",
1818
"docker:stop": "turbo run docker:stop",
1919
"docker:clean": "turbo run docker:clean",
20-
"cap-setup": "node scripts/setup.js"
20+
"cap-setup": "node --env-file .env scripts/setup.js"
2121
},
2222
"devDependencies": {
2323
"@turbo/gen": "^1.9.7",

scripts/setup.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ const __root = path.resolve(path.join(__dirname, ".."));
1515
const targetDir = path.join(__root, "target");
1616

1717
const arch =
18-
process.env.RUST_ARCH ?? process.arch === "arm64" ? "aarch64" : "x86_64";
18+
process.env.RUST_TARGET_TRIPLE?.split("-")[0] ??
19+
(process.arch === "arm64" ? "aarch64" : "x86_64");
1920

2021
async function main() {
2122
await fs.mkdir(targetDir, { recursive: true });
@@ -29,15 +30,13 @@ async function main() {
2930
aarch64: "native-deps-aarch64-darwin-apple.tar.xz",
3031
};
3132

32-
const nativeDepsTar = `native-deps-${NATIVE_DEPS_VERSION}.tar.xz`;
33+
const nativeDepsTar = NATIVE_DEPS_ASSETS[arch];
3334
const nativeDepsTarPath = path.join(targetDir, nativeDepsTar);
3435
let downloadedNativeDeps = false;
3536

3637
if (!(await fileExists(nativeDepsTarPath))) {
3738
console.log(`Downloading ${nativeDepsTar}`);
38-
const nativeDepsBytes = await fetch(
39-
`${NATIVE_DEPS_URL}/${NATIVE_DEPS_ASSETS[arch]}`
40-
)
39+
const nativeDepsBytes = await fetch(`${NATIVE_DEPS_URL}/${nativeDepsTar}`)
4140
.then((r) => r.blob())
4241
.then((b) => b.arrayBuffer());
4342
await fs.writeFile(nativeDepsTarPath, Buffer.from(nativeDepsBytes));

0 commit comments

Comments
 (0)