Skip to content

Commit

Permalink
fix: ci
Browse files Browse the repository at this point in the history
  • Loading branch information
louis030195 committed Jul 22, 2024
1 parent b772111 commit 294edf0
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ jobs:

# Run pre build
- name: Run pre_build.js on ${{ matrix.platform }}
run: bun ./examples/apps/screenpipe-app-tauri/scripts/pre_build.js ${{ matrix.pre-build-args }}
run: bun ./scripts/pre_build.js ${{ matrix.pre-build-args }}
working-directory: ./examples/apps/screenpipe-app-tauri

- name: Install Linux dependencies
if: matrix.platform == 'ubuntu-24.04'
Expand Down
47 changes: 46 additions & 1 deletion .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,48 @@ jobs:
name: screenpipe-linux
path: screenpipe-linux.tar.gz

build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- name: Install FFmpeg
run: |
choco install ffmpeg
- name: Build release
run: |
cargo build --release
- name: Download FFmpeg
run: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" -OutFile "ffmpeg.zip"
Expand-Archive -Path "ffmpeg.zip" -DestinationPath "ffmpeg"
Move-Item -Path "ffmpeg\ffmpeg-master-latest-win64-gpl\bin\*" -Destination "target\release\"
- name: Create deployment package
run: |
$VERSION = $env:GITHUB_REF -replace 'refs/tags/v', ''
Compress-Archive -Path target\release\screenpipe.exe, target\release\ffmpeg.exe, target\release\ffprobe.exe -DestinationPath screenpipe-$VERSION-x86_64-pc-windows-msvc.zip
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: screenpipe-windows
path: screenpipe-*.zip

release:
runs-on: ubuntu-latest
needs: [build-ubuntu]
needs: [build-ubuntu, build-macos, build-windows]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -126,6 +165,11 @@ jobs:
with:
name: screenpipe-macos

- name: Download Windows Artifact
uses: actions/download-artifact@v2
with:
name: screenpipe-windows

- name: Set Version
shell: bash
run: |
Expand All @@ -139,3 +183,4 @@ jobs:
gh release create ${{ env.RELEASE_VERSION }} --title ${{ env.RELEASE_VERSION }} --generate-notes
gh release upload ${{ env.RELEASE_VERSION }} screenpipe-linux.tar.gz
gh release upload ${{ env.RELEASE_VERSION }} screenpipe-macos.tar.gz
gh release upload ${{ env.RELEASE_VERSION }} screenpipe-windows.zip
6 changes: 5 additions & 1 deletion examples/apps/screenpipe-app-tauri/scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ if (platform == 'macos') {
// Install lame using Homebrew
await $`brew install lame`
// Copy lame to ffmpeg ! NEED SUDO
await $`sudo cp -r /opt/homebrew/opt/lame/lib/* ${config.ffmpegRealname}/lib/`
if (await fs.exists(`${config.ffmpegRealname}/lib/`)) {
await $`sudo cp -r /opt/homebrew/opt/lame/lib/* ${config.ffmpegRealname}/lib/`
} else { // ci
await $`sudo cp -r /opt/homebrew/opt/lame/lib/* ./src-tauri/${config.ffmpegRealname}/lib/`
}

// Setup FFMPEG
if (!(await fs.exists(config.ffmpegRealname))) {
Expand Down
13 changes: 13 additions & 0 deletions screenpipe-core/src/ffmpeg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,19 @@ pub fn find_ffmpeg_path() -> Option<PathBuf> {
}
}

#[cfg(target_os = "linux")]
{
let lib_folder = exe_folder.join("lib");
debug!("Lib folder: {:?}", lib_folder);
let ffmpeg_in_lib = lib_folder.join(EXECUTABLE_NAME);
if ffmpeg_in_lib.exists() {
debug!("Found ffmpeg in lib folder: {:?}", ffmpeg_in_lib);
return Some(ffmpeg_in_lib);
} else {
debug!("ffmpeg not found in lib folder");
}
}

error!("ffmpeg not found");
// crash
panic!("ffmpeg not found");
Expand Down

0 comments on commit 294edf0

Please sign in to comment.