Skip to content

Remove the no-default-features #25

Remove the no-default-features

Remove the no-default-features #25

Workflow file for this run

name: SDWebImage/librav1e-Xcode
on:
push:
# Pattern matched against refs/tags
tags:
- '*'
env:
LC_CTYPE: en_US.UTF-8
LANG: en_US.UTF-8
jobs:
build:
runs-on: macos-12
env:
DEVELOPER_DIR: /Applications/Xcode_13.4.1.app
steps:
- name: Checkout
uses: actions/checkout@v4.0.0
- name: Set up cargo cache
uses: actions/cache@v3.3.2
with:
path: |
~/.cargo/registry
~/.cargo/git
rav1e/target
key: "${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}"
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
default: true
toolchain: 1.65.0
- name: Set up rust
run: |
rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-darwin x86_64-apple-darwin
HOMEBREW_NO_AUTO_UPDATE=1 brew install nasm
- name: Clone rav1e
run: |
cd "${{ github.workspace }}"
mkdir include
rm -rf rav1e
git clone -b "v${{ github.ref_name }}" --depth 1 https://github.com/xiph/rav1e.git
- name: Install cargo package
run: |
cd "${{ github.workspace }}/rav1e"
cargo install cargo-lipo
cargo install cbindgen
cargo install cargo-crate-type
- name: Configure rav1e
run: |
cd "${{ github.workspace }}/rav1e"
cbindgen -c cbindgen.toml -l C -o include/rav1e/rav1e.h --crate rav1e .
cargo crate-type static
# iOS
- name: Build iOS
run: |
cd "${{ github.workspace }}/rav1e"
rm -rf "${{ github.workspace }}/rav1e/target"
cargo lipo --release --features "asm capi" --targets=aarch64-apple-ios,x86_64-apple-ios
cd "${{ github.workspace }}"
mkdir -p Build
cd Build
mkdir iOS
cd iOS
mkdir librav1e.framework
cd librav1e.framework
mkdir Headers
mkdir Modules
cp "${{ github.workspace }}/rav1e/target/universal/release/librav1e.a" librav1e
cp "${{ github.workspace }}/rav1e/include/rav1e/rav1e.h" Headers/
cp "${{ github.workspace }}/module.modulemap" Modules/
# MacOS
- name: Build macOS
run: |
cd "${{ github.workspace }}/rav1e"
rm -rf "${{ github.workspace }}/rav1e/target"
cargo lipo --release --features "asm capi" --targets=aarch64-apple-darwin,x86_64-apple-darwin
cd "${{ github.workspace }}"
mkdir -p Build
cd Build
mkdir Mac
cd Mac
mkdir librav1e.framework
cd librav1e.framework
mkdir Versions
cd Versions
mkdir A
ln -s A Current
cd A
mkdir Headers
mkdir Modules
cp "${{ github.workspace }}/rav1e/target/universal/release/librav1e.a" librav1e
cp "${{ github.workspace }}/rav1e/include/rav1e/rav1e.h" Headers/
cp "${{ github.workspace }}/module.modulemap" Modules/
cd ../../
ln -s Versions/Current/librav1e librav1e
ln -s Versions/Current/Headers Headers
ln -s Versions/Current/Modules Modules
# Zip
- name: Archive
run: |
cd "${{ github.workspace }}"
cd Build
zip -y -r librav1e.zip Mac/ iOS/
- uses: softprops/action-gh-release@v0.1.15
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_REPOSITORY: "${{ github.repository }}"
with:
files: "${{ github.workspace }}/Build/librav1e.zip"