💚 remove sudo in macos ci build #40
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 | |
on: | |
push: | |
branches: [main] | |
tags: ["*"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
name: Build project | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
submodules: true | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install FFmpeg | |
run: | | |
if [ "${{ runner.os }}" = "Linux" ]; then | |
sudo apt-get update | |
sudo apt-get install libavformat-dev libavcodec-dev libavutil-dev libswresample-dev | |
elif [ "${{ runner.os }}" = "macOS" ]; then | |
brew install ffmpeg | |
elif [ "${{ runner.os }}" = "Windows" ]; then | |
curl --location https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n7.1-latest-win64-lgpl-shared-7.1.zip --output ffmpeg.zip | |
unzip ffmpeg.zip | |
fi | |
shell: bash | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
run: | | |
export name=mltd-git-$(git describe --tags --dirty)-${{ runner.os }} | |
if [ "${{ runner.os }}" = "Windows" ]; then | |
export FFMPEG_DIR=$PWD/ffmpeg-n7.1-latest-win64-lgpl-shared-7.1 | |
cargo build-windows --release | |
export name=$name.exe | |
else | |
cargo build --release | |
fi | |
echo "name=$name" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Publish artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.version.outputs.name }} | |
path: target/release/mltd-git-* |