Build Rust AE plugin in CI #258
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 Workspace | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- age-test | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
workflow_dispatch: | ||
env: | ||
CARGO_TERM_COLOR: always | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Install gstreamer | ||
uses: awalsh128/cache-apt-pkgs-action@v1 | ||
with: | ||
packages: libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libatk1.0-dev libgtk-3-dev | ||
version: 2.0 | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Build | ||
run: cargo build --release --workspace | ||
- name: Build OpenFX plugin | ||
run: cargo run --bin build-plugin -- --release | ||
- name: Archive Linux OpenFX plugin | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref_type == 'tag' }} | ||
with: | ||
name: ntsc-rs-linux-openfx | ||
path: crates/openfx-plugin/build/ | ||
- name: Archive Linux binary | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref_type == 'tag' }} | ||
with: | ||
name: ntsc-rs-linux-standalone | ||
path: target/release/ntsc-rs-standalone | ||
build-windows: | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Disable Defender | ||
run: Set-MpPreference -DisableRealtimeMonitoring $true | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- name: Set chocolatey temp directory | ||
run: | | ||
choco config set cacheLocation --value "$Env:GITHUB_WORKSPACE\chocolatey_cache" | ||
echo "CHOCO_TEMP=$Env:GITHUB_WORKSPACE\chocolatey_cache" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Restore Chocolatey cache | ||
id: choco-cache-restore | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ env.CHOCO_TEMP }} | ||
key: 'this should never hit' | ||
restore-keys: choco-${{ github.job }}- | ||
- name: Install gstreamer | ||
run: | | ||
choco install gstreamer gstreamer-devel | ||
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1 | ||
refreshenv | ||
echo "$($Env:GSTREAMER_1_0_ROOT_MSVC_X86_64)bin" | ||
echo "$($Env:GSTREAMER_1_0_ROOT_MSVC_X86_64)bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
echo "GSTREAMER_1_0_ROOT_MSVC_X86_64=$Env:GSTREAMER_1_0_ROOT_MSVC_X86_64" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Save Chocolatey cache | ||
id: choco-cache-save | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ env.CHOCO_TEMP }} | ||
key: choco-${{ github.job }}-${{ hashFiles(format('{0}\**\*', env.CHOCO_TEMP)) }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: Build GUI | ||
run: cargo build --release -p gui | ||
- name: Build OpenFX plugin | ||
run: cargo run --bin build-plugin -- --release | ||
- name: Build After Effects plugin | ||
run: | | ||
cargo build --release -p ae-plugin | ||
cp target\release\ae_plugin.dll .\ntsc-rs-ae.aex | ||
- name: Archive Windows OpenFX plugin | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref_type == 'tag' }} | ||
with: | ||
name: ntsc-rs-windows-openfx | ||
path: crates/openfx-plugin/build/ | ||
- name: Package Windows binary | ||
if: ${{ github.ref_type == 'tag' }} | ||
run: | | ||
mkdir ntsc-rs-windows-standalone | ||
cd ntsc-rs-windows-standalone | ||
robocopy $Env:GSTREAMER_1_0_ROOT_MSVC_X86_64 .\ *.dll /s /copy:DT; if ($lastexitcode -lt 8) { $global:LASTEXITCODE = $null } | ||
robocopy $Env:GSTREAMER_1_0_ROOT_MSVC_X86_64\share\licenses .\licenses /s /copy:DT; if ($lastexitcode -lt 8) { $global:LASTEXITCODE = $null } | ||
cp ..\target\release\ntsc-rs-standalone.exe .\bin\ | ||
cp ..\target\release\ntsc-rs-launcher.exe .\ | ||
- name: Archive Windows binary | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref_type == 'tag' }} | ||
with: | ||
name: ntsc-rs-windows-standalone | ||
path: ntsc-rs-windows-standalone | ||
- name: Archive Windows After Effects plugin | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ github.ref_type == 'tag' }} | ||
with: | ||
name: ntsc-rs-windows-afterfx | ||
path: .\ntsc-rs-ae.aex | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
needs: | ||
- build-windows | ||
- build-linux | ||
- build-ae-plugin | ||
Check failure on line 145 in .github/workflows/build-workspace.yml GitHub Actions / Build WorkspaceInvalid workflow file
|
||
if: ${{ github.ref_type == 'tag' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ./artifacts | ||
- name: Zip artifacts | ||
run: for dir in */; do zip -r "${dir%/}.zip" "${dir%/}"; done | ||
working-directory: ./artifacts | ||
- name: Display structure of downloaded files | ||
run: ls -l | ||
working-directory: ./artifacts | ||
- name: Create release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "./artifacts/ntsc-rs-*-standalone.zip,./artifacts/ntsc-rs-*-openfx.zip,./artifacts/ntsc-rs-*-afterfx.zip" | ||
draft: true |