Build for all platforms #50
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build for all platforms | |
on: | |
workflow_dispatch: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
Linux_ffmpeg4: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Packages | |
run: sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y | |
- name: Build | |
run: | | |
cargo build --release | |
strip target/release/bliss-analyser | |
mkdir releases | |
cp target/release/bliss-analyser releases/bliss-analyser | |
cp UserGuide.md releases/README.md | |
cp LICENSE releases/ | |
cp configs/linux.ini releases/config.ini | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: bliss-analyser-linux-x86-ffmpeg4 | |
path: releases/ | |
Linux_ffmpeg5: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Packages | |
run: sudo add-apt-repository ppa:savoury1/ffmpeg4 -y && sudo add-apt-repository ppa:savoury1/ffmpeg5 -y && sudo apt-get update && sudo apt-get install build-essential yasm libavutil-dev libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libswresample-dev libfftw3-dev ffmpeg -y | |
- name: Build | |
run: | | |
cargo build --release | |
strip target/release/bliss-analyser | |
mkdir releases | |
cp target/release/bliss-analyser releases/bliss-analyser | |
cp UserGuide.md releases/README.md | |
cp LICENSE releases/ | |
cp configs/linux.ini releases/config.ini | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: bliss-analyser-linux-x86-ffmpeg5 | |
path: releases/ | |
Linux_ARM: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Build ARM | |
run: | | |
docker build -t bliss-analyser-cross - < docker/Dockerfile | |
docker run --rm -v $PWD/target:/build -v $PWD:/src bliss-analyser-cross | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: bliss-analyser-linux-arm | |
path: releases/ | |
# macOs builds are failing: error: could not find system library 'libavutil' required by the 'ffmpeg-sys-next' crate | |
# macOS: | |
# runs-on: macos-11.0 | |
# | |
# steps: | |
# - name: Install Rust | |
# uses: actions-rs/toolchain@v1 | |
# with: | |
# toolchain: stable | |
# | |
# - name: Checkout | |
# uses: actions/checkout@v2 | |
# | |
# - name: Install deps | |
# run: | | |
# brew install ffmpeg@5 | |
# | |
# - name: Build | |
# run: | | |
# mkdir releases | |
# cargo build --release | |
# strip target/release/bliss-analyser | |
# cp target/release/bliss-analyser releases/bliss-analyser | |
# cp UserGuide.md releases/README.md | |
# cp LICENSE releases/ | |
# cp configs/macos.ini releases/config.ini | |
# | |
# - name: Upload artifacts | |
# uses: actions/upload-artifact@v2 | |
# with: | |
# name: bliss-analyser-mac | |
# path: releases/ | |
Windows: | |
runs-on: windows-2019 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install deps | |
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 "https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z" -OutFile ffmpeg-shared.7z | |
7z x ffmpeg-shared.7z | |
mkdir deps | |
mv ffmpeg-*/* deps/ | |
Add-Content $env:GITHUB_ENV "FFMPEG_DIR=${pwd}\deps`n" | |
Add-Content $env:GITHUB_PATH "${pwd}\deps\bin`n" | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Build | |
run: | | |
cargo build --release | |
mkdir releases | |
cp target/release/bliss-analyser.exe releases/bliss-analyser.exe | |
cp deps/bin/*.dll releases/ | |
cp UserGuide.md releases/README.md | |
cp LICENSE releases/ | |
cp configs/windows.ini releases/config.ini | |
cp c:\Windows\system32\vcruntime140.dll releases | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: bliss-analyser-windows | |
path: releases/ |