Skip to content

Updated rust-cache actions to v2 and upgraded to new rust toolchain with cargo #837

Updated rust-cache actions to v2 and upgraded to new rust toolchain with cargo

Updated rust-cache actions to v2 and upgraded to new rust toolchain with cargo #837

Workflow file for this run

name: Rust
on: [push, pull_request]
jobs:
build_ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install alsa
run: sudo apt update && sudo apt install libasound2-dev libgtk-3-dev
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Build Ubuntu Release
run: cargo build --release
- name: Chmod +x
run: chmod +x target/release/neothesia
- name: zip binary
run: zip -rj app.zip target/release/neothesia
- uses: actions/upload-artifact@v4
with:
name: ubuntu-artifact
path: app.zip
build_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Build Windows Release
run: cargo build --release
- uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: target/release/neothesia.exe
build_macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Build MacOSk Release
run: cargo build --release
- name: copy binary
run: cp target/release/neothesia .github/app/Neothesia.app/Contents/MacOS
- name: zip binary
run: cd .github/app/ && zip -r app.zip Neothesia.app && cd ../..
- uses: actions/upload-artifact@v4
with:
name: macos-artifact
path: .github/app/app.zip
build_ubuntu_recorder:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install alsa
run: sudo apt update && sudo apt install libasound2-dev libgtk-3-dev libavcodec-dev libavformat-dev libswscale-dev
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Build Ubuntu Release
run: cargo build --release -p neothesia-cli
- name: Chmod +x
run: chmod +x target/release/neothesia-cli
- name: zip binary
run: zip -rj app.zip target/release/neothesia-cli
- uses: actions/upload-artifact@v4
with:
name: ubuntu-recorder-artifact
path: app.zip
build_windows_recorder:
runs-on: windows-latest
env:
FFMPEG_DOWNLOAD_URL: https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z
steps:
- uses: actions/checkout@v4
- name: Install dependencies
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"
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
- name: Build Ubuntu Release
run: cargo build --release -p neothesia-cli
- uses: actions/upload-artifact@v4
with:
name: windows-recorder-artifact
path: target/release/neothesia-cli.exe