Skip to content

馃摑 Add demo video comparison to README #61

馃摑 Add demo video comparison to README

馃摑 Add demo video comparison to README #61

Workflow file for this run

name: Build
on:
push:
branches: [ "main", "master" ]
tags: [ "v*" ]
pull_request:
branches: [ "main", "master" ]
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
build-linux-dynamic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libclang-dev clang libavcodec-dev libavformat-dev libavfilter-dev libavdevice-dev libavutil-dev
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-dynamic-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose --release
- name: Run Tests
run: cargo test --verbose
- name: Upload Binary Artifact
uses: actions/upload-artifact@v4
with:
name: desilence-rs-linux-dynamic
path: target/release/desilence-rs
retention-days: 10
- name: Package Release Artifact
if: startsWith(github.ref, 'refs/tags/')
run: |
cp target/release/desilence-rs desilence-rs-linux-dynamic-x86_64
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: asset-linux-dynamic
path: desilence-rs-linux-dynamic-x86_64
retention-days: 1
build-linux-static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y yasm nasm pkg-config libclang-dev clang
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-static-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose --release --features static
- name: Run Tests
run: cargo test --verbose --features static
- name: Upload Binary Artifact
uses: actions/upload-artifact@v4
with:
name: desilence-rs-linux-static
path: target/release/desilence-rs
retention-days: 10
- name: Package Release Artifact
if: startsWith(github.ref, 'refs/tags/')
run: |
cp target/release/desilence-rs desilence-rs-linux-static-x86_64
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: asset-linux-static
path: desilence-rs-linux-static-x86_64
retention-days: 1
validate-readme:
runs-on: ubuntu-latest
needs: build-linux-static
steps:
- uses: actions/checkout@v4
- name: Download Linux Binary
uses: actions/download-artifact@v4
with:
name: desilence-rs-linux-static
path: ./
- name: Make Binary Executable
run: chmod +x desilence-rs
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Validate README Options
run: python3 scripts/update-readme-help.py --check --binary ./desilence-rs
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-windows-${{ hashFiles('**/Cargo.lock') }}
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Build
shell: powershell
run: .\build.ps1 -RunTests
- name: Upload Binary Artifact
uses: actions/upload-artifact@v4
with:
name: desilence-rs-windows
path: |
target/release/desilence-rs.exe
target/release/*.dll
retention-days: 10
- name: Package Release Artifact
if: startsWith(github.ref, 'refs/tags/')
shell: powershell
run: |
Copy-Item target/release/desilence-rs.exe desilence-rs-windows-x86_64.exe
# DLLs are already copied to target/release by build.ps1, but we need them in the valid artifact list
# We can just archive them from the output directory
$dlls = Get-ChildItem "target/release/*.dll"
$filesToZip = @("desilence-rs-windows-x86_64.exe") + $dlls.FullName
Compress-Archive -Path $filesToZip -DestinationPath desilence-rs-windows-x86_64.zip
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: asset-windows
path: desilence-rs-windows-x86_64.zip
retention-days: 1
release:
runs-on: ubuntu-latest
needs: [build-linux-dynamic, build-linux-static, build-windows]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
pattern: asset-*
merge-multiple: true
- name: Display structure of downloaded files
run: ls -R release-assets
- name: Upload Release
uses: softprops/action-gh-release@v2
with:
files: release-assets/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}