Skip to content

Commit f1c7d3c

Browse files
authored
Merge pull request #2 from SDWebImage/convert-sdwebimage-librav1e-xcode-to-actions-20230922-085610
Convert SDWebImage/librav1e-Xcode to GitHub Actions
2 parents fce0a6f + 6a9a37e commit f1c7d3c

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: SDWebImage/librav1e-Xcode
2+
on:
3+
push:
4+
branches:
5+
- "**/*"
6+
pull_request:
7+
concurrency:
8+
# # This item has no matching transformer
9+
# maximum_number_of_builds: 0
10+
group: "${{ github.ref }}"
11+
cancel-in-progress: true
12+
env:
13+
LC_CTYPE: en_US.UTF-8
14+
LANG: en_US.UTF-8
15+
jobs:
16+
test:
17+
runs-on: macos-latest
18+
if: ${{ github.ref }}
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v4.0.0
22+
- uses: maxim-lobanov/setup-xcode@v1.5.1
23+
with:
24+
xcode-version: '11.3'
25+
- name: Set up cargo cache
26+
uses: actions/cache@v3.3.2
27+
with:
28+
path: |
29+
~/.cargo/registry
30+
~/.cargo/git
31+
target
32+
key: "${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}"
33+
- name: Set up cache
34+
uses: actions/cache@v3.3.2
35+
with:
36+
path: "${{ github.workspace }}/.cargo"
37+
key: "${{ runner.os }}-path"
38+
- uses: actions-rs/toolchain@v1.0.6
39+
with:
40+
toolchain: 1.41.0
41+
- run: env
42+
- run: locale
43+
- run: xcodebuild -version
44+
- run: xcodebuild -showsdks
45+
- run: rustup target add aarch64-apple-ios armv7-apple-ios armv7s-apple-ios x86_64-apple-ios i386-apple-ios x86_64-apple-darwin
46+
- run: cargo install cargo-lipo
47+
- run: cargo install cbindgen
48+
- run: HOMEBREW_NO_AUTO_UPDATE=1 brew install nasm
49+
- run: cargo build --verbose
50+
- run: set -o pipefail
51+
- run: mkdir include
52+
- run: rm -rf rav1e
53+
- run: git clone -b "v${{ github.ref }}" --depth 1 https://github.com/xiph/rav1e.git
54+
- run: cd rav1e
55+
- run: cbindgen -c cbindgen.toml -l C -o include/rav1e/rav1e.h --crate rav1e .
56+
- run: cargo build --release --no-default-features --features "asm capi" --target x86_64-apple-darwin
57+
- run: cargo lipo --release --no-default-features --features "asm capi" --targets=aarch64-apple-ios,armv7-apple-ios,x86_64-apple-ios,i386-apple-ios
58+
- run: cd ${{ github.workspace }}
59+
- run: mkdir Build
60+
- run: cd Build
61+
- run: mkdir iOS
62+
- run: cd iOS
63+
- run: mkdir librav1e.framework
64+
- run: cd librav1e.framework
65+
- run: mkdir Headers
66+
- run: mkdir Modules
67+
- run: cp ${{ github.workspace }}/rav1e/target/universal/release/librav1e.a librav1e
68+
- run: cp ${{ github.workspace }}/rav1e/include/rav1e/rav1e.h Headers/
69+
- run: cp ${{ github.workspace }}/module.modulemap Modules/
70+
- run: cd ${{ github.workspace }}
71+
- run: cd Build
72+
- run: mkdir Mac
73+
- run: cd Mac
74+
- run: mkdir librav1e.framework
75+
- run: cd librav1e.framework
76+
- run: mkdir Versions
77+
- run: cd Versions
78+
- run: mkdir A
79+
- run: ln -s A Current
80+
- run: cd A
81+
- run: mkdir Headers
82+
- run: mkdir Modules
83+
- run: cp ${{ github.workspace }}/rav1e/target/x86_64-apple-darwin/release/librav1e.a librav1e
84+
- run: cp ${{ github.workspace }}/rav1e/include/rav1e/rav1e.h Headers/
85+
- run: cp ${{ github.workspace }}/module.modulemap Modules/
86+
- run: cd ../../
87+
- run: ln -s Versions/Current/librav1e librav1e
88+
- run: ln -s Versions/Current/Headers Headers
89+
- run: ln -s Versions/Current/Modules Modules
90+
- run: cd ${{ github.workspace }}
91+
- run: cd Build
92+
- run: zip -y -r librav1e.zip Mac/ iOS/
93+
- uses: softprops/action-gh-release@v0.1.15
94+
env:
95+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
96+
GITHUB_REPOSITORY: "${{ github.repository }}"
97+
with:
98+
files: "${{ github.workspace }}/Build/librav1e.zip"
99+
if: "${{ github.event_name == 'push' && ${{ github.ref }} }}"
100+
# # This item has no matching transformer
101+
# - email: false

0 commit comments

Comments
 (0)