Skip to content

deploy

deploy #289

Workflow file for this run

name: deploy
on:
schedule:
- cron: '0 21 * * TUE' # Run every Tuesday at 21:00 (UTC)
push:
tags:
- 'v*.*.*'
- 'p*'
jobs:
windows-rav1e-ch-binary:
if: github.repository_owner == 'xiph'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/setup-nasm@v1
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: Build rav1e-ch (unstable)
env:
RUSTFLAGS: "-C target-cpu=x86-64-v3"
CARGO_PROFILE_RELEASE_LTO: "true"
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1"
run: cargo build --release --features=unstable,channel-api --bin=rav1e-ch
- name: Upload rav1e-ch msvc binary (unstable)
uses: actions/upload-artifact@v4
with:
name: rav1e-ch (unstable) (AVX2)
path: target/release/rav1e-ch.exe
windows-binaries:
strategy:
matrix:
conf:
- msvc
- gnu
target_cpu:
- x86-64
- x86-64-v2
- x86-64-v3
include:
- conf: msvc
name: msvc-generic
toolchain: stable
profile: release
target_cpu: x86-64
- conf: msvc
name: msvc-sse4
toolchain: stable
profile: release
target_cpu: x86-64-v2
- conf: msvc
name: msvc-avx2
toolchain: stable
profile: release
target_cpu: x86-64-v3
- conf: gnu
name: gnu-generic
toolchain: stable-x86_64-pc-windows-gnu
profile: release-no-lto
target_cpu: x86-64
- conf: gnu
name: gnu-sse4
toolchain: stable-x86_64-pc-windows-gnu
profile: release-no-lto
target_cpu: x86-64-v2
- conf: gnu
name: gnu-avx2
toolchain: stable-x86_64-pc-windows-gnu
profile: release-no-lto
target_cpu: x86-64-v3
if: github.repository_owner == 'xiph'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/setup-nasm@v1
- name: Install cargo-c
run: |
$LINK = "https://github.com/lu-zero/cargo-c/releases/latest/download"
$CARGO_C_FILE = "cargo-c-windows-msvc"
curl -LO "$LINK/$CARGO_C_FILE.zip"
7z e -y "$CARGO_C_FILE.zip" -o"${env:USERPROFILE}\.cargo\bin"
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Install mingw-w64-x86_64-binutils and mingw-w64-x86_64-gcc
run: |
C:\msys64\usr\bin\pacman.exe --noconfirm --needed -S mingw-w64-x86_64-binutils mingw-w64-x86_64-gcc
if: contains(matrix.toolchain, 'windows-gnu')
- name: Build rav1e
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.target_cpu }}"
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: "C:\\msys64\\mingw64\\bin\\x86_64-w64-mingw32-gcc.exe"
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_AR: "C:\\msys64\\mingw64\\bin\\ar.exe"
run: cargo build --profile ${{ matrix.profile }}
- name: Run cargo-c
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.target_cpu }}"
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER: "C:\\msys64\\mingw64\\bin\\x86_64-w64-mingw32-gcc.exe"
CARGO_TARGET_X86_64_PC_WINDOWS_GNU_AR: "C:\\msys64\\mingw64\\bin\\ar.exe"
run: |
cargo fetch
cargo cinstall `
--profile ${{ matrix.profile }} `
--destdir="C:\" `
--libdir lib --prefix /usr/rav1e-windows-${{ matrix.conf }}-sdk `
--offline
- name: Copy LICENSE
run: Copy-Item "LICENSE" "C:\usr\rav1e-windows-${{ matrix.conf }}-sdk\LICENSE"
- name: Get the version
if: startsWith(github.ref, 'refs/tags/v')
shell: bash
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Package pre-release binaries
if: >
startsWith(github.ref, 'refs/tags/p') || github.event_name == 'schedule'
run: |
7z a rav1e-windows-${{ matrix.name }}.zip `
"C:\usr\rav1e-windows-${{ matrix.conf }}-sdk"
- name: Package release binaries
if: startsWith(github.ref, 'refs/tags/v')
run: |
$ZIP_PREFIX = "rav1e-${{ steps.tagName.outputs.version }}-windows"
7z a "$ZIP_PREFIX-${{ matrix.name }}.zip" `
"C:\usr\rav1e-windows-${{ matrix.conf }}-sdk"
- name: Upload rav1e msvc binary
if: matrix.conf == 'msvc'
uses: actions/upload-artifact@v4
with:
name: rav1e (Windows-${{ matrix.name }})
path: target/${{ matrix.profile }}/rav1e.exe
- name: Upload pre-release binaries
if: >
startsWith(github.ref, 'refs/tags/p') || github.event_name == 'schedule'
uses: actions/upload-artifact@v4
with:
name: librav1e (Windows-${{ matrix.name }})
path: rav1e-windows-${{ matrix.name }}.zip
- name: Upload release binaries
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: rav1e ${{ steps.tagName.outputs.version }} (Windows-${{ matrix.name }})
path: rav1e-${{ steps.tagName.outputs.version }}-windows-${{ matrix.name }}.zip
linux-binaries:
strategy:
fail-fast: false
matrix:
target:
- i686-unknown-linux-musl
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
target_cpu:
- default
- x86-64
- x86-64-v2
- x86-64-v3
build:
- binary
- sdk
include:
- build: binary
pkgname: rav1e
- build: sdk
pkgname: librav1e
- target: i686-unknown-linux-musl
name: linux-i686
- target: aarch64-unknown-linux-musl
name: linux-aarch64
- target: x86_64-unknown-linux-musl
target_cpu: x86-64
name: linux-generic
- target: x86_64-unknown-linux-musl
target_cpu: x86-64-v2
name: linux-sse4
- target: x86_64-unknown-linux-musl
target_cpu: x86-64-v3
name: linux-avx2
exclude:
- target: x86_64-unknown-linux-musl
target_cpu: default
- target: aarch64-unknown-linux-musl
target_cpu: x86-64
- target: aarch64-unknown-linux-musl
target_cpu: x86-64-v2
- target: aarch64-unknown-linux-musl
target_cpu: x86-64-v3
- target: i686-unknown-linux-musl
target_cpu: x86-64
- target: i686-unknown-linux-musl
target_cpu: x86-64-v2
- target: i686-unknown-linux-musl
target_cpu: x86-64-v3
if: github.repository_owner == 'xiph'
runs-on: ubuntu-latest
name: linux-binaries (${{ matrix.build }}, ${{ matrix.name }})
steps:
- uses: actions/checkout@v4
- uses: ilammy/setup-nasm@v1
- name: Install ${{ matrix.target }} target
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Install cross
if: matrix.target != 'x86_64-unknown-linux-musl'
env:
LINK: https://github.com/cross-rs/cross/releases/download
CROSS_VERSION: 0.2.5
CROSS_FILE: cross-x86_64-unknown-linux-musl
run: |
curl -L "$LINK/v$CROSS_VERSION/$CROSS_FILE.tar.gz" |
tar xz -C $HOME/.cargo/bin
- name: Install cargo-c
if: matrix.build == 'sdk'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz
run: |
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin
- name: Build rav1e for non-native architectures
if: matrix.build == 'binary' && matrix.target != 'x86_64-unknown-linux-musl'
run: cross build --target ${{ matrix.target }} --profile release-strip
- name: Build librav1e for non-native architectures
if: matrix.build == 'sdk' && matrix.target != 'x86_64-unknown-linux-musl'
env:
# We get around cross's lack of support for third-party subcommands by
# defining a custom Dockerfile whose entrypoint rewrites the
# "cargo build" command to "cargo cinstall"
CROSS_BUILD_DOCKERFILE: ./cross/Dockerfile.libs
CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_RUSTFLAGS:
"-C target-feature=-crt-static"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS:
"-C target-feature=-crt-static"
run: |
cp ~/.cargo/bin/cargo-c* $(dirname $(rustup which cargo))
cross build --target ${{ matrix.target }} --profile release-strip
- name: Build rav1e
if: matrix.build == 'binary' && matrix.target == 'x86_64-unknown-linux-musl'
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.target_cpu }}"
run: cargo build --target ${{ matrix.target }} --profile release-strip
- name: Build librav1e
if: matrix.build == 'sdk' && matrix.target == 'x86_64-unknown-linux-musl'
env:
RUSTFLAGS:
"-C target-feature=-crt-static -C target-cpu=${{ matrix.target_cpu }}"
run: |
cargo cinstall --target ${{ matrix.target }} \
--prefix dist \
--library-type staticlib \
--library-type cdylib \
--profile release-strip
- name: Get pre-release artifact filename
if: |
startsWith(github.ref, 'refs/tags/p') ||
github.event_name == 'schedule'
run: |
echo "ARTIFACT_FILE=${{ matrix.pkgname }}-${{ matrix.name }}.tar.gz" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ matrix.pkgname }} (${{ matrix.name }})" >> $GITHUB_ENV
- name: Get release artifact filename
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "ARTIFACT_FILE=${{ matrix.pkgname }}-$VERSION-${{ matrix.name }}.tar.gz" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ matrix.pkgname }} $VERSION (${{ matrix.name }})" >> $GITHUB_ENV
- name: Create a binary tar
if: >
matrix.build == 'binary' &&
(startsWith(github.ref, 'refs/tags/p') ||
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule')
run: |
cd target/${{ matrix.target }}/release-strip
tar -czvf $GITHUB_WORKSPACE/$ARTIFACT_FILE rav1e
- name: Create a lib tar
if: >
matrix.build == 'sdk' &&
(startsWith(github.ref, 'refs/tags/p') ||
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule')
run: |
cp LICENSE dist
cd dist
tar -czvf $GITHUB_WORKSPACE/$ARTIFACT_FILE *
- name: Upload artifact
if: >
startsWith(github.ref, 'refs/tags/p') ||
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule'
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_FILE }}
macos-binaries:
if: github.repository_owner == 'xiph'
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
build:
- binary
- sdk
include:
- target: x86_64-apple-darwin
name: macos
macosx_deployment_target: "10.10"
- target: aarch64-apple-darwin
name: macos-aarch64
macosx_deployment_target: "11.0"
- build: binary
pkgname: rav1e
ext: zip
- build: sdk
pkgname: librav1e
ext: tar.gz
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }}
steps:
- uses: actions/checkout@v4
- name: Install nasm
run: brew install nasm
- name: Install ${{ matrix.target }} target
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
- name: Install cargo-c
if: matrix.build == 'sdk'
env:
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download
CARGO_C_FILE: cargo-c-macos.zip
run: |
curl -sLo cargo-c-macos.zip $LINK/$CARGO_C_FILE
unzip -o cargo-c-macos.zip -d ~/.cargo/bin
rm cargo-c-macos.zip
- name: Build rav1e
if: matrix.build == 'binary'
run: cargo build --target ${{ matrix.target }} --profile release-strip
- name: Build librav1e
if: matrix.build == 'sdk'
run: |
cargo cinstall --target ${{ matrix.target }} \
--prefix dist \
--library-type staticlib \
--library-type cdylib \
--profile release-strip
- name: Get pre-release artifact filename
if: |
startsWith(github.ref, 'refs/tags/p') ||
github.event_name == 'schedule'
run: |
echo "ARTIFACT_FILE=${{ matrix.pkgname }}-${{ matrix.name }}.${{ matrix.ext }}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ matrix.pkgname }} (${{ matrix.name }})" >> $GITHUB_ENV
- name: Get release artifact filename
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "ARTIFACT_FILE=${{ matrix.pkgname }}-$VERSION-${{ matrix.name }}.${{ matrix.ext }}" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ matrix.pkgname }} $VERSION (${{ matrix.name }})" >> $GITHUB_ENV
- name: Create a binary zip
if: >
matrix.build == 'binary' &&
(startsWith(github.ref, 'refs/tags/p') ||
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule')
run: |
cd target/${{ matrix.target }}/release-strip
zip -9 $GITHUB_WORKSPACE/$ARTIFACT_FILE rav1e
- name: Create a lib tar
if: >
matrix.build == 'sdk' &&
(startsWith(github.ref, 'refs/tags/p') ||
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule')
run: |
cp LICENSE dist
cd dist
tar -czvf $GITHUB_WORKSPACE/$ARTIFACT_FILE *
- name: Upload artifact
if: >
startsWith(github.ref, 'refs/tags/p') ||
startsWith(github.ref, 'refs/tags/v') ||
github.event_name == 'schedule'
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.ARTIFACT_FILE }}
deploy:
needs: [windows-rav1e-ch-binary, windows-binaries, linux-binaries, macos-binaries]
if: github.repository_owner == 'xiph'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Get the version
if: startsWith(github.ref, 'refs/tags/v')
id: tagName
run: |
VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Get date for a scheduled pre-release
if: github.event_name == 'schedule'
id: tagDate
run: |
DATE=$(date "+%Y%m%d")
echo "date=$DATE" >> $GITHUB_OUTPUT
- name: Create a scheduled pre-release
if: github.event_name == 'schedule'
uses: softprops/action-gh-release@v2
with:
name: Weekly pre-release
prerelease: true
tag_name: p${{ steps.tagDate.outputs.date }}
files: |
Cargo.lock
rav1e (Windows-msvc-generic)/rav1e.exe
rav1e-ch (unstable) (AVX2)/rav1e-ch.exe
rav1e (linux-generic)/rav1e-linux-generic.tar.gz
rav1e (linux-i686)/rav1e-linux-i686.tar.gz
rav1e (linux-sse4)/rav1e-linux-sse4.tar.gz
rav1e (linux-avx2)/rav1e-linux-avx2.tar.gz
rav1e (linux-aarch64)/rav1e-linux-aarch64.tar.gz
rav1e (macos)/rav1e-macos.zip
rav1e (macos-aarch64)/rav1e-macos-aarch64.zip
librav1e (linux-generic)/librav1e-linux-generic.tar.gz
librav1e (linux-i686)/librav1e-linux-i686.tar.gz
librav1e (linux-sse4)/librav1e-linux-sse4.tar.gz
librav1e (linux-avx2)/librav1e-linux-avx2.tar.gz
librav1e (linux-aarch64)/librav1e-linux-aarch64.tar.gz
librav1e (macos)/librav1e-macos.tar.gz
librav1e (macos-aarch64)/librav1e-macos-aarch64.tar.gz
librav1e (Windows-msvc-generic)/rav1e-windows-msvc-generic.zip
librav1e (Windows-msvc-sse4)/rav1e-windows-msvc-sse4.zip
librav1e (Windows-msvc-avx2)/rav1e-windows-msvc-avx2.zip
librav1e (Windows-gnu-generic)/rav1e-windows-gnu-generic.zip
librav1e (Windows-gnu-sse4)/rav1e-windows-gnu-sse4.zip
librav1e (Windows-gnu-avx2)/rav1e-windows-gnu-avx2.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create a pre-release
if: startsWith(github.ref, 'refs/tags/p')
uses: softprops/action-gh-release@v2
with:
name: Weekly pre-release
prerelease: true
files: |
Cargo.lock
rav1e (Windows-msvc-generic)/rav1e.exe
rav1e-ch (unstable) (AVX2)/rav1e-ch.exe
rav1e (linux-generic)/rav1e-linux-generic.tar.gz
rav1e (linux-i686)/rav1e-linux-i686.tar.gz
rav1e (linux-sse4)/rav1e-linux-sse4.tar.gz
rav1e (linux-avx2)/rav1e-linux-avx2.tar.gz
rav1e (linux-aarch64)/rav1e-linux-aarch64.tar.gz
rav1e (macos)/rav1e-macos.zip
rav1e (macos-aarch64)/rav1e-macos-aarch64.zip
librav1e (linux-generic)/librav1e-linux-generic.tar.gz
librav1e (linux-i686)/librav1e-linux-i686.tar.gz
librav1e (linux-sse4)/librav1e-linux-sse4.tar.gz
librav1e (linux-avx2)/librav1e-linux-avx2.tar.gz
librav1e (linux-aarch64)/librav1e-linux-aarch64.tar.gz
librav1e (macos)/librav1e-macos.tar.gz
librav1e (macos-aarch64)/librav1e-macos-aarch64.tar.gz
librav1e (Windows-msvc-generic)/rav1e-windows-msvc-generic.zip
librav1e (Windows-msvc-sse4)/rav1e-windows-msvc-sse4.zip
librav1e (Windows-msvc-avx2)/rav1e-windows-msvc-avx2.zip
librav1e (Windows-gnu-generic)/rav1e-windows-gnu-generic.zip
librav1e (Windows-gnu-sse4)/rav1e-windows-gnu-sse4.zip
librav1e (Windows-gnu-avx2)/rav1e-windows-gnu-avx2.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create a release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
name: v${{ steps.tagName.outputs.version }}
files: |
Cargo.lock
rav1e (Windows-msvc-generic)/rav1e.exe
rav1e-ch (unstable) (AVX2)/rav1e-ch.exe
rav1e ${{ steps.tagName.outputs.version }} (linux-generic)/rav1e-${{ steps.tagName.outputs.version }}-linux-generic.tar.gz
rav1e ${{ steps.tagName.outputs.version }} (linux-i686)/rav1e-${{ steps.tagName.outputs.version }}-linux-i686.tar.gz
rav1e ${{ steps.tagName.outputs.version }} (linux-sse4)/rav1e-${{ steps.tagName.outputs.version }}-linux-sse4.tar.gz
rav1e ${{ steps.tagName.outputs.version }} (linux-avx2)/rav1e-${{ steps.tagName.outputs.version }}-linux-avx2.tar.gz
rav1e ${{ steps.tagName.outputs.version }} (linux-aarch64)/rav1e-${{ steps.tagName.outputs.version }}-linux-aarch64.tar.gz
rav1e ${{ steps.tagName.outputs.version }} (macos)/rav1e-${{ steps.tagName.outputs.version }}-macos.zip
rav1e ${{ steps.tagName.outputs.version }} (macos-aarch64)/rav1e-${{ steps.tagName.outputs.version }}-macos-aarch64.zip
librav1e ${{ steps.tagName.outputs.version }} (linux-generic)/librav1e-${{ steps.tagName.outputs.version }}-linux-generic.tar.gz
librav1e ${{ steps.tagName.outputs.version }} (linux-i686)/librav1e-${{ steps.tagName.outputs.version }}-linux-i686.tar.gz
librav1e ${{ steps.tagName.outputs.version }} (linux-sse4)/librav1e-${{ steps.tagName.outputs.version }}-linux-sse4.tar.gz
librav1e ${{ steps.tagName.outputs.version }} (linux-avx2)/librav1e-${{ steps.tagName.outputs.version }}-linux-avx2.tar.gz
librav1e ${{ steps.tagName.outputs.version }} (linux-aarch64)/librav1e-${{ steps.tagName.outputs.version }}-linux-aarch64.tar.gz
librav1e ${{ steps.tagName.outputs.version }} (macos)/librav1e-${{ steps.tagName.outputs.version }}-macos.tar.gz
librav1e ${{ steps.tagName.outputs.version }} (macos-aarch64)/librav1e-${{ steps.tagName.outputs.version }}-macos-aarch64.tar.gz
rav1e ${{ steps.tagName.outputs.version }} (Windows-msvc-generic)/rav1e-${{ steps.tagName.outputs.version }}-windows-msvc-generic.zip
rav1e ${{ steps.tagName.outputs.version }} (Windows-msvc-sse4)/rav1e-${{ steps.tagName.outputs.version }}-windows-msvc-sse4.zip
rav1e ${{ steps.tagName.outputs.version }} (Windows-msvc-avx2)/rav1e-${{ steps.tagName.outputs.version }}-windows-msvc-avx2.zip
rav1e ${{ steps.tagName.outputs.version }} (Windows-gnu-generic)/rav1e-${{ steps.tagName.outputs.version }}-windows-gnu-generic.zip
rav1e ${{ steps.tagName.outputs.version }} (Windows-gnu-sse4)/rav1e-${{ steps.tagName.outputs.version }}-windows-gnu-sse4.zip
rav1e ${{ steps.tagName.outputs.version }} (Windows-gnu-avx2)/rav1e-${{ steps.tagName.outputs.version }}-windows-gnu-avx2.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}