Repository navigation
158 lines (155 loc) · 4.67 KB
/
Copy pathbuild a lib.yml
File metadata and controls
158 lines (155 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# https://github.com/actions/runner-images
on:
# push:
# branches: [master]
workflow_dispatch:
inputs:
os:
description: 'macos version'
required: false
type: choice
default: 'macos-26'
options:
- macos-13
- macos-14
- macos-15
- macos-15-intel
- macos-26
platform:
description: 'choose a platform for compile'
required: false
type: choice
default: 'all'
options:
- apple
- android
- ohos
- all
- ios
- tvos
- macos
lib:
description: 'choose a lib for compile'
required: true
type: choice
default: 'ffmpeg7'
options:
- ffmpeg8
- ffmpeg8-bin
- ffmpeg7
- ffmpeg6
- ffmpeg5
- ffmpeg4
- ijkffmpeg
- fftutorial
- ass
- bluray
- dav1d
- dvdread
- dvdnav
- harfbuzz
- fontconfig
- freetype
- fribidi
- lcms2
- placebo
- moltenvk
- openssl3
- openssl
- opus
- shaderc
- smb2
- soundtouch
- uavs3d
- x264
- x265
- unibreak
- yuv
- xml2
- webp
- dovi
dryrun:
description: 'just run workflow,but not deploy'
required: false
type: choice
default: 'false'
options:
- true
- false
verbose:
description: 'print detail logs'
required: true
type: choice
default: 'false'
options:
- true
- false
pull_request:
branches: [master]
name: build a lib
jobs:
build:
name: compile ${{ inputs.lib }} for ${{ inputs.platform }} then deploy
runs-on: ${{ inputs.os }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: nttld/setup-ndk@v1
id: setup-ndk
if: |
github.event.inputs.platform == 'all' ||
github.event.inputs.platform == 'android'
with:
ndk-version: r27c
add-to-path: true
link-to-sdk: true
local-cache: false
- name: Setup HarmonyOS native SDK
if: |
github.event.inputs.platform == 'ohos' ||
github.event.inputs.platform == 'all'
shell: bash
run: |
set -euo pipefail
SDK_WORK="$RUNNER_TEMP/ohos-sdk"
mkdir -p "$SDK_WORK"
NATIVE_ZIP="$SDK_WORK/native.zip"
# Fast path: native zip mirrored as a GitHub release asset (direct CDN URL).
MIRROR_URL="https://github.com/debugly/MRFFToolChainBuildShell/releases/download/ohos-native-sdk-5.0.0.71/native.zip"
if ! curl -fL --retry 3 --retry-delay 5 "$MIRROR_URL" -o "$NATIVE_ZIP"; then
echo "Mirror download failed; falling back to huaweicloud..."
SDK_URL="https://repo.huaweicloud.com/harmonyos/os/5.0.0-Release/ohos-sdk-mac-public.tar.gz"
curl -fL --retry 5 --retry-delay 5 "$SDK_URL" -o "$SDK_WORK/ohos-sdk.tar.gz"
tar -xzf "$SDK_WORK/ohos-sdk.tar.gz" -C "$SDK_WORK"
NATIVE_ZIP=$(find "$SDK_WORK" -type f -name 'native-darwin-*.zip' | head -n 1)
[ -z "$NATIVE_ZIP" ] && NATIVE_ZIP=$(find "$SDK_WORK" -type f -name 'native-*.zip' | head -n 1)
fi
if [ -z "$NATIVE_ZIP" ] || [ ! -f "$NATIVE_ZIP" ]; then
echo "!! native SDK zip not found"
find "$SDK_WORK" -maxdepth 4 -type f | sort
exit 1
fi
unzip -q "$NATIVE_ZIP" -d "$SDK_WORK/native-sdk"
OHOS_NATIVE=$(find "$SDK_WORK/native-sdk" -type d -name native | head -n 1)
[ -z "$OHOS_NATIVE" ] && OHOS_NATIVE="$SDK_WORK/native-sdk/native"
if [ ! -f "$OHOS_NATIVE/llvm/bin/clang" ]; then
echo "!! clang not found under $OHOS_NATIVE"
find "$SDK_WORK/native-sdk" -maxdepth 3 -type d | sort
exit 1
fi
echo "OHOS_SDK_NATIVE=$OHOS_NATIVE" >> "$GITHUB_ENV"
echo "HarmonyOS native SDK at: $OHOS_NATIVE"
ls -la "$OHOS_NATIVE/llvm/bin/clang"
- name: Checkout code
uses: actions/checkout@v4
- name: Install cargo-c
if: inputs.lib == 'dovi'
uses: taiki-e/install-action@v2
with:
tool: cargo-c
- name: Install dependencies
run: .github/workflows/install-dependencies.sh ${{ inputs.lib }} ${{ inputs.platform }}
- name: One Step
run: .github/workflows/onestep.sh ${{ inputs.lib }} ${{ inputs.platform }} ${{ inputs.dryrun }} ${{ inputs.verbose }}
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}