ci: fix ffmpeg action

This commit is contained in:
Brendan Allan 2022-04-23 18:33:04 +08:00
parent 8c915cd5a6
commit aed09ae907
2 changed files with 3 additions and 119 deletions

View file

@ -5,6 +5,7 @@ runs:
steps:
- name: Install ffmpeg (Ubuntu)
if: matrix.platform == 'ubuntu-latest'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
@ -21,10 +22,12 @@ runs:
- name: Install ffmpeg (macOS)
if: matrix.platform == 'macos-latest'
shell: bash
run: brew install ffmpeg
- name: Install ffmpeg (Windows)
if: matrix.platform == 'windows-latest'
shell: powershell
run: |
$VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n"

View file

@ -1,119 +0,0 @@
name: CI
on:
pull_request:
push:
branches:
- main
- new-ci
paths-ignore:
- "**/.md"
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
env:
FFMPEG_DOWNLOAD_URL: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
RUST_CACHE_VERSION: 0
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v2
# from https://github.com/zmwangx/rust-ffmpeg/blob/master/.github/workflows/build.yml
- name: Install ffmpeg (Windows)
if: matrix.platform == 'windows-latest'
run: |
$VCINSTALLDIR = $(& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath)
Add-Content $env:GITHUB_ENV "LIBCLANG_PATH=${VCINSTALLDIR}\VC\Tools\LLVM\x64\bin`n"
Invoke-WebRequest "${env:FFMPEG_DOWNLOAD_URL}" -OutFile ffmpeg-release-full-shared.7z
7z x ffmpeg-release-full-shared.7z
mkdir ffmpeg
mv ffmpeg-*/* ffmpeg/
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\ffmpeg`n"
Add-Content $env:GITHUB_PATH "${pwd}\ffmpeg\bin`n"
- name: Install CMake (Windows)
uses: lukka/get-cmake@latest
if: matrix.platform == 'windows-latest'
# Optimisation for windows
- name: Rename existing rust toolchain (Windows)
if: matrix.platform == 'windows-latest'
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Install Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
components: rustfmt, rust-src
- name: Cache Rust Dependencies
uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c
with:
sharedKey: ${{ env.RUST_CACHE_VERSION }}
- name: Cache pnpm dependencies
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install pnpm
uses: pnpm/action-setup@v2.2.1
with:
version: 6.32.6
- name: Install dependencies (Ubuntu)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libgtk-3-dev \
webkit2gtk-4.0 \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavresample-dev \
libavutil-dev \
libswscale-dev \
libswresample-dev \
pkg-config \
ffmpeg
- name: Install dependencies (macOS)
if: matrix.platform == 'macos-latest'
run: |
brew install ffmpeg
- name: Install pnpm dependencies
run: pnpm i
- name: Build codegen
run: pnpm prep:ci
- name: Build frontend
run: pnpm desktop build:vite
- name: Build Tauri app
uses: tauri-apps/tauri-action@v0
with:
projectPath: apps/desktop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}