release ci

This commit is contained in:
Robin Appelman 2023-08-05 19:44:05 +02:00
commit c91f1e0d28
2 changed files with 127 additions and 1 deletions

View file

@ -1,6 +1,11 @@
name: CI
on: [ push, pull_request ]
on:
pull_request:
push:
branches:
- main
- master
jobs:
build-linux:
@ -72,6 +77,7 @@ jobs:
with:
name: purpledot
path: target/release/purpledot
build-windows:
runs-on: windows-latest
steps:

120
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,120 @@
name: CI
on:
release:
types: [published]
jobs:
build-linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
# https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
- name: Install FFmpegBuildTools
run: |
sudo apt-get update -qq && sudo apt-get -y install \
autoconf \
automake \
build-essential \
cmake \
git-core \
libass-dev \
libfreetype6-dev \
libgnutls28-dev \
libsdl2-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxcb1-dev \
libxcb-shm0-dev \
libxcb-xfixes0-dev \
pkg-config \
texinfo \
wget \
yasm \
zlib1g-dev
sudo apt-get -y install nasm
sudo apt-get -y install libx264-dev
sudo apt-get -y install libx265-dev libnuma-dev
sudo apt-get -y install libvpx-dev
sudo apt-get -y install libfdk-aac-dev
sudo apt-get -y install libmp3lame-dev
sudo apt-get -y install libopus-dev
- name: Cache ffmpeg
id: cache-ffmpeg
uses: actions/cache@v3
with:
path: ~/ffmpeg_build
key: ${{ runner.os }}-ffmpeg
- name: Build ffmpeg
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: |
git clone https://github.com/ffmpeg/ffmpeg --branch n6.0 --depth 1
cd ffmpeg
mkdir build
cd build
../configure --prefix=${PWD}/build
make -j$(nproc)
make install
cp -r ./build ~/ffmpeg_build
cd ../..
- name: Build
run: |
FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include \
FFMPEG_PKG_CONFIG_PATH=${HOME}/ffmpeg_build/lib/pkgconfig \
cargo build --release --locked
- uses: svenstaro/upload-release-action@v2
with:
asset_name: purpledot
file: target/release/purpledot
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
# Using this since it's used by clang-sys's CI
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
directory: ${{ github.workspace }}/clang
- name: Cache vcpkg
id: cache-vcpkg
uses: actions/cache@v3
with:
path: vcpkg
key: ${{ runner.os }}-vcpkg
- name: Vcpkg install ffmpeg
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
run: |
git clone https://github.com/microsoft/vcpkg -b 2023.07.21 --single-branch --depth 1
./vcpkg/bootstrap-vcpkg.bat
./vcpkg/vcpkg.exe install ffmpeg:x64-windows-static --triplet x86-windows
- name: Build
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
LIBCLANG_PATH: ${{ github.workspace }}/clang/lib
LLVM_CONFIG_PATH: ${{ github.workspace }}/clang/bin/llvm-config
run: cargo build --release --locked
- uses: svenstaro/upload-release-action@v2
with:
asset_name: purpledot.exe
file: target/release/purpledot.exe
tag: ${{ github.ref }}
repo_token: ${{ secrets.GITHUB_TOKEN }}