Skip to content

Commit 1181661

Browse files
committed
publish ijk and github edition.
1 parent 94efbf3 commit 1181661

File tree

6 files changed

+146
-22
lines changed

6 files changed

+146
-22
lines changed
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
branches: [ master ]
6+
7+
name: Create Release (Github Edition)
8+
9+
jobs:
10+
build:
11+
name: compile libs then deploy
12+
runs-on: macos-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
- name: Read Tag Version
17+
run: |
18+
# https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
19+
# git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs echo > constants.env
20+
git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs echo > constants.env
21+
echo 'EDITION=github' >> constants.env
22+
cat constants.env
23+
- name: Export Env
24+
uses: cardinalby/export-env-action@v2
25+
with:
26+
envFile: 'constants.env'
27+
- name: do compile macos libs
28+
run: |
29+
export SKIP_FFMPEG_PATHCHES=1
30+
./init-any.sh macos
31+
cd macos
32+
./compile-any.sh build
33+
./compile-any.sh lipo
34+
- name: Zip macos libs
35+
run: |
36+
cd build/product/macos/universal
37+
zip -rq macos-universal.zip ./*
38+
- name: do compile ios libs
39+
run: |
40+
export SKIP_FFMPEG_PATHCHES=1
41+
export SKIP_PULL_BASE=1
42+
./init-any.sh ios
43+
cd ios
44+
./compile-any.sh build
45+
./compile-any.sh lipo
46+
- name: Zip ios libs
47+
run: |
48+
cd build/product/ios/universal
49+
zip -rq ios-universal.zip ./*
50+
- name: Create Release
51+
id: create_release
52+
uses: actions/create-release@v1
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
tag_name: ${{ env.RELEASE_VERSION }}
57+
release_name: Release ${{ env.RELEASE_VERSION }}
58+
draft: false
59+
prerelease: false
60+
- name: Upload macos Release Asset
61+
uses: actions/upload-release-asset@v1
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
with:
65+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
66+
asset_path: build/product/macos/universal/macos-universal.zip
67+
asset_name: "macos-universal-${{ env.EDITION }}-${{ env.RELEASE_VERSION }}.zip"
68+
asset_content_type: application/zip
69+
- name: Upload ios Release Asset
70+
uses: actions/upload-release-asset@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
75+
asset_path: build/product/ios/universal/ios-universal.zip
76+
asset_name: "ios-universal-${{ env.EDITION }}-${{ env.RELEASE_VERSION }}.zip"
77+
asset_content_type: application/zip

.github/workflows/publish-release.yml renamed to .github/workflows/publish-ijk-release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
branches: [ master ]
66

7-
name: Create Release
7+
name: Create Release (IJK Edition)
88

99
jobs:
1010
build:
@@ -18,6 +18,7 @@ jobs:
1818
# https://stackoverflow.com/questions/4916492/git-describe-fails-with-fatal-no-names-found-cannot-describe-anything
1919
# git describe --tags --always | awk -F . '{printf "RELEASE_VERSION=%s.%d",$1,$2+1}' | xargs echo > constants.env
2020
git describe --tags --always | awk -F - '{printf "RELEASE_VERSION=V1.0-%s",$NF}' | xargs echo > constants.env
21+
echo 'EDITION=ijk' >> constants.env
2122
cat constants.env
2223
- name: Export Env
2324
uses: cardinalby/export-env-action@v2
@@ -35,6 +36,7 @@ jobs:
3536
zip -rq macos-universal.zip ./*
3637
- name: do compile ios libs
3738
run: |
39+
export SKIP_PULL_BASE=1
3840
./init-any.sh ios
3941
cd ios
4042
./compile-any.sh build
@@ -60,7 +62,7 @@ jobs:
6062
with:
6163
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
6264
asset_path: build/product/macos/universal/macos-universal.zip
63-
asset_name: "macos-universal-${{ env.RELEASE_VERSION }}.zip"
65+
asset_name: "macos-universal-${{ env.EDITION }}-${{ env.RELEASE_VERSION }}.zip"
6466
asset_content_type: application/zip
6567
- name: Upload ios Release Asset
6668
uses: actions/upload-release-asset@v1
@@ -69,5 +71,5 @@ jobs:
6971
with:
7072
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
7173
asset_path: build/product/ios/universal/ios-universal.zip
72-
asset_name: "ios-universal-${{ env.RELEASE_VERSION }}.zip"
74+
asset_name: "ios-universal-${{ env.EDITION }}-${{ env.RELEASE_VERSION }}.zip"
7375
asset_content_type: application/zip

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ At present MRFFToolChain contained OpenSSL、FFmpeg 、libyuv、libopus、libblu
8888
/init-all.sh all "openssl ffmpeg"
8989
```
9090

91+
高级选项:
92+
93+
设置环境变量 export SKIP_FFMPEG_PATHCHES=1 不打 FFmpeg 补丁;
94+
设置环境变量 export SKIP_PULL_BASE=1 不从远程拉取最新代码;
95+
9196
## Compile
9297

9398
根据编译的平台,进入相应的目录,比如编译 macos 平台:
@@ -159,4 +164,11 @@ cd macos
159164

160165
1、如果不同的平台需要编译不同的库,只需要在 apple/compile-cfgs 目录下,建立 list_PLAT.txt 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下按照 list.txt 里声明的顺序编译各个库。
161166

162-
2、ffmpeg 的配置需要分平台指定,只需要在 ffconfig 目录下创建 module_PLAT.sh 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下根据 module.sh 声明的配置进行编译 ffmpeg。
167+
2、ffmpeg 的配置需要分平台指定,只需要在 ffconfig 目录下创建 module_PLAT.sh 文件即可,PLAT 为对应的平台,比如 ios,macos 等;默认情况下根据 module.sh 声明的配置进行编译 ffmpeg。
168+
169+
## Precompiled Edition
170+
171+
预编译库分为 ijk 版和 github 版,其区别是 ijk 版本打了 extra/patches/ffmpeg 目录下的补丁。
172+
173+
- 下载 ijk 版预编译库:./download-pre.sh ijk
174+
- 下载 github 版预编译库:./download-pre.sh github

download-pre.sh

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,56 @@
1515
# limitations under the License.
1616
#
1717

18-
PLAT=$1
19-
VER=$2
18+
set -e
19+
20+
EDITION=$1
21+
PLAT=$2
22+
VER=$3
2023

2124
if test -z $VER ;then
2225
VER='V1.0-104be8c'
2326
fi
2427

25-
set -e
28+
if test -z $PLAT ;then
29+
PLAT='all'
30+
fi
2631

2732
cd $(dirname "$0")
2833
c_dir="$PWD"
2934

3035
function usage() {
3136
echo " useage:"
32-
echo " $0 [ios,macos,all]"
37+
echo "download precompiled ijk or github edition."
38+
echo " $0 ijk|github [ios|macos|all] [<release tag>]"
3339
}
3440

3541
function download() {
3642
local plat=$1
37-
echo "===[download $plat $VER]===================="
43+
echo "===[download $plat $EDITION $VER]===================="
3844
mkdir -p build/pre
3945
cd build/pre
40-
echo "https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$VER/$plat-universal-$VER.zip"
41-
curl -LO https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$VER/$plat-universal-$VER.zip
46+
local fname="$plat-universal-$EDITION-$VER.zip"
47+
echo "https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$VER/$fname"
48+
curl -LO https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$VER/$fname
4249
mkdir -p ../product/$plat/universal
43-
unzip -oq $plat-universal-$VER.zip -d ../product/$plat/universal
50+
unzip -oq $fname -d ../product/$plat/universal
4451
tree -L 2 ../product/$plat/universal
4552
echo "===================================="
4653
cd - >/dev/null
4754
}
4855

56+
if [[ "$EDITION" != 'ijk' && "$EDITION" != 'github' ]]; then
57+
echo 'wrong edition,use ijk or github!'
58+
usage
59+
exit
60+
fi
61+
62+
if [[ "$PLAT" != 'ios' && "$PLAT" != 'macos' && "$PLAT" != 'all' ]]; then
63+
echo 'wrong plat,use ios or macos or all!'
64+
usage
65+
exit
66+
fi
67+
4968
if [[ "$PLAT" == 'ios' || "$PLAT" == 'macos' ]]; then
5069
download $PLAT
5170
elif [[ "$PLAT" == 'all' ]]; then

init-any.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ function usage()
3838
echo " $0 [ios,macos,all] [all|fdk-aac|ffmpeg|lame|libyuv|openssl|opus|x264|bluray] [all,arm64,x86_64]"
3939
}
4040

41+
if [[ "$SKIP_PULL_BASE" ]];then
42+
echo "SKIP_PULL_BASE env recognized"
43+
fi
44+
45+
if [[ "$SKIP_FFMPEG_PATHCHES" ]];then
46+
echo "SKIP_FFMPEG_PATHCHES env recognized"
47+
fi
48+
4149
if [[ "x$LIBS" == "x" || "$LIBS" == "all" ]]; then
4250
LIBS=$(ls init-cfgs)
4351
fi

tools/init-repo.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ARCH=$3
3737
if [[ "$ARCH" == 'all' || "x$ARCH" == 'x' ]];then
3838
iOS_ARCHS="x86_64 arm64"
3939
macOS_ARCHS="x86_64 arm64"
40-
elif [[ "$ARCH" == 'x86_64' || "$ARCH" == 'arm64' ]];then
40+
elif [[ "$ARCH" == 'x86_64' || "$ARCH" == 'arm64' ]];then
4141
iOS_ARCHS="$ARCH"
4242
macOS_ARCHS="$ARCH"
4343
else
@@ -51,7 +51,7 @@ function pull_common() {
5151
cd "$GIT_LOCAL_REPO"
5252
[[ -d .git/rebase-apply ]] && git am --skip
5353
git reset --hard
54-
54+
5555
local origin=$(git remote get-url origin)
5656
if [[ "$origin" != "$GIT_UPSTREAM" ]]; then
5757
git remote remove origin
@@ -61,7 +61,7 @@ function pull_common() {
6161
if [[ "$SKIP_PULL_BASE" ]];then
6262
echo "skip pull $REPO_DIR because you set SKIP_PULL_BASE env."
6363
else
64-
git fetch --all --tags
64+
git fetch --all --tags
6565
fi
6666
else
6767
if [[ "$SKIP_PULL_BASE" ]];then
@@ -82,8 +82,14 @@ function pull_common() {
8282

8383
function apply_patches()
8484
{
85+
if [[ "$SKIP_FFMPEG_PATHCHES" && $REPO_DIR == 'ffmpeg' ]];then
86+
echo "skip apply $REPO_DIR patches,because you set SKIP_FFMPEG_PATHCHES env."
87+
return
88+
fi
89+
8590
local plat="$1"
8691
local patch_dir="${TOOLS}/../extra/patches/$REPO_DIR"
92+
8793
if [[ -d "${patch_dir}_${plat}" ]];then
8894
patch_dir="${patch_dir}_${plat}"
8995
fi
@@ -105,7 +111,7 @@ function make_arch_repo() {
105111
echo "== copy $REPO_DIR$dest_repo =="
106112
$TOOLS/copy-local-repo.sh $GIT_LOCAL_REPO $dest_repo
107113
cd $dest_repo
108-
if [[ "$GIT_WITH_SUBMODULE" ]]; then
114+
if [[ "$GIT_WITH_SUBMODULE" ]];then
109115
git submodule update --init --depth=1
110116
fi
111117
echo "last commit:"$(git log -1 --pretty=format:"[%h] %s:%ce %cd")
@@ -130,12 +136,12 @@ function main() {
130136
make_arch_repo 'ios' $arch
131137
fi
132138
done
133-
139+
134140
if [[ found -eq 0 ]];then
135141
echo "unknown arch:$2 for $1"
136142
fi
137143
;;
138-
144+
139145
macOS|macos)
140146

141147
pull_common
@@ -147,25 +153,25 @@ function main() {
147153
make_arch_repo 'macos' $arch
148154
fi
149155
done
150-
156+
151157
if [[ found -eq 0 ]];then
152158
echo "unknown arch:$2 for $1"
153159
fi
154160
;;
155-
161+
156162
all)
157163
pull_common
158164
for arch in $iOS_ARCHS
159165
do
160166
make_arch_repo 'ios' $arch
161167
done
162-
168+
163169
for arch in $macOS_ARCHS
164170
do
165171
make_arch_repo 'macos' $arch
166172
done
167173
;;
168-
174+
169175
*)
170176
usage
171177
exit 1

0 commit comments

Comments
 (0)