Skip to content

Commit 473ca36

Browse files
committed
upload universal zip
1 parent 9afad16 commit 473ca36

File tree

4 files changed

+269
-2
lines changed

4 files changed

+269
-2
lines changed

.github/workflows/unibreak.yml

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,22 @@ jobs:
4343
- name: do compile macos libs
4444
run: |
4545
./macos/compile-any.sh -c build -l ${{ env.LIB_NAME }}
46+
cd build/product/macos/universal
47+
zip -rq macos-universal.zip ./*
4648
- name: do compile ios libs
4749
run: |
4850
./ios/compile-any.sh -c build -l ${{ env.LIB_NAME }}
51+
cd build/product/ios/universal
52+
zip -rq ios-universal.zip ./*
53+
cd ../universal-simulator
54+
zip -rq ios-universal-simulator.zip ./*
4955
- name: do compile tvos libs
5056
run: |
5157
./tvos/compile-any.sh -c build -l ${{ env.LIB_NAME }}
58+
cd build/product/tvos/universal
59+
zip -rq tvos-universal.zip ./*
60+
cd ../universal-simulator
61+
zip -rq tvos-universal-simulator.zip ./*
5262
- name: Zip apple xcframework
5363
run: |
5464
cd build/product/xcframework
@@ -64,7 +74,7 @@ jobs:
6474
release_name: ${{ env.LIB_NAME }}-${{ env.RELEASE_VERSION }}
6575
draft: false
6676
prerelease: false
67-
- name: Upload Apple Plat Release Asset
77+
- name: Upload xcframework Release Asset
6878
uses: actions/upload-release-asset@v1
6979
env:
7080
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -73,6 +83,51 @@ jobs:
7383
asset_path: build/product/apple-xcframework.zip
7484
asset_name: "${{ env.LIB_NAME }}-apple-xcframework-${{ env.RELEASE_VERSION }}.zip"
7585
asset_content_type: application/zip
86+
- name: Upload iOS Plat Release Asset
87+
uses: actions/upload-release-asset@v1
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90+
with:
91+
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
92+
asset_path: build/product/ios/universal/ios-universal.zip
93+
asset_name: "${{ env.LIB_NAME }}-ios-universal-${{ env.RELEASE_VERSION }}.zip"
94+
asset_content_type: application/zip
95+
- name: Upload iOS Simulator Plat Release Asset
96+
uses: actions/upload-release-asset@v1
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
with:
100+
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
101+
asset_path: build/product/ios/universal-simulator/ios-universal-simulator.zip
102+
asset_name: "${{ env.LIB_NAME }}-ios-universal-simulator-${{ env.RELEASE_VERSION }}.zip"
103+
asset_content_type: application/zip
104+
- name: Upload macOS Plat Release Asset
105+
uses: actions/upload-release-asset@v1
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
with:
109+
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
110+
asset_path: build/product/macos/universal/macos-universal.zip
111+
asset_name: "${{ env.LIB_NAME }}-macos-universal-${{ env.RELEASE_VERSION }}.zip"
112+
asset_content_type: application/zip
113+
- name: Upload tvOS Plat Release Asset
114+
uses: actions/upload-release-asset@v1
115+
env:
116+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117+
with:
118+
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
119+
asset_path: build/product/tvos/universal/tvos-universal.zip
120+
asset_name: "${{ env.LIB_NAME }}-tvos-universal-${{ env.RELEASE_VERSION }}.zip"
121+
asset_content_type: application/zip
122+
- name: Upload tvOS Simulator Plat Release Asset
123+
uses: actions/upload-release-asset@v1
124+
env:
125+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126+
with:
127+
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
128+
asset_path: build/product/tvos/universal-simulator/tvos-universal-simulator.zip
129+
asset_name: "${{ env.LIB_NAME }}-tvos-universal-simulator-${{ env.RELEASE_VERSION }}.zip"
130+
asset_content_type: application/zip
76131
- name: Upload macos src md
77132
uses: actions/upload-release-asset@v1
78133
env:

install-pre-any.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DAV1D_TAG='dav1d-1.3.0-231127183948'
3030
OPENSSL_TAG='openssl-1.1.1w-231127183927'
3131
DVDREAD_TAG='dvdread-6.1.3-240108102425'
3232
FREETYPE_TAG='freetype-2.13.2-240320173506'
33-
UNIBREAK_TAG='unibreak-5.1-231229171455'
33+
UNIBREAK_TAG='unibreak-5.1-240604135117'
3434
FRIBIDI_TAG='fribidi-1.0.13-240320172504'
3535
HARFBUZZ_TAG='harfbuzz-8.3.0-240320182151'
3636
ASS_TAG='ass-0.17.1-240320183602'

install-pre-xcframeworks.sh

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2022 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# ./install-pre-any.sh all
18+
# ./install-pre-any.sh ios 'libyuv openssl opus bluray dav1d'
19+
# ./install-pre-any.sh macos 'openssl'
20+
# ./install-pre-any.sh macos 'openssl ffmpeg'
21+
22+
23+
#----------------------------------------------------------
24+
# 当发布新版本库时,修改对应的 TAG 值
25+
#----------------------------------------------------------
26+
UNIBREAK_TAG='unibreak-5.1-240604135117'
27+
OPUS_TAG=''
28+
MAC_BLURAY_TAG=''
29+
DAV1D_TAG=''
30+
OPENSSL_TAG=''
31+
DVDREAD_TAG=''
32+
FREETYPE_TAG=''
33+
FRIBIDI_TAG=''
34+
HARFBUZZ_TAG=''
35+
ASS_TAG=''
36+
FFMPEG_TAG=''
37+
#----------------------------------------------------------
38+
39+
set -e
40+
41+
LIBS="$1"
42+
43+
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
44+
cd "$THIS_DIR"
45+
46+
function usage() {
47+
echo "=== useage ===================="
48+
echo "Download pre-compiled xcframeworks from github:"
49+
echo " $0 [all|openssl|opus|bluray|dav1d|freetype|fribidi|harfbuzz|unibreak|ass|ffmpeg]"
50+
exit 1
51+
}
52+
53+
if [[ "$LIBS" == "-h" || -z "$LIBS" ]]; then
54+
usage
55+
fi
56+
57+
if [[ "$LIBS" == "all" ]]; then
58+
LIBS=$(ls init-cfgs)
59+
fi
60+
61+
for lib in $LIBS
62+
do
63+
TAG=
64+
echo "===[install pre-compile $lib]===================="
65+
66+
case $lib in
67+
'ffmpeg')
68+
TAG=$FFMPEG_TAG
69+
;;
70+
'libyuv')
71+
TAG=$LIBYUV_TAG
72+
;;
73+
'openssl')
74+
TAG=$OPENSSL_TAG
75+
;;
76+
'opus')
77+
TAG=$OPUS_TAG
78+
;;
79+
'bluray')
80+
TAG=$MAC_BLURAY_TAG
81+
;;
82+
'dav1d')
83+
TAG=$DAV1D_TAG
84+
;;
85+
'dvdread')
86+
TAG=$DVDREAD_TAG
87+
;;
88+
'freetype')
89+
TAG=$FREETYPE_TAG
90+
;;
91+
'harfbuzz')
92+
TAG=$HARFBUZZ_TAG
93+
;;
94+
'fribidi')
95+
TAG=$FRIBIDI_TAG
96+
;;
97+
'unibreak')
98+
TAG=$UNIBREAK_TAG
99+
;;
100+
'ass')
101+
TAG=$ASS_TAG
102+
;;
103+
*)
104+
echo "wrong lib name:$lib"
105+
usage
106+
;;
107+
esac
108+
109+
if [[ -z "$TAG" ]]; then
110+
echo "== $lib tag is empty,just skip it."
111+
else
112+
echo "== install $lib -> $TAG"
113+
./tools/install-pre-xcf.sh "$TAG"
114+
fi
115+
echo "===================================="
116+
done

tools/install-pre-xcf.sh

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2022 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
set -e
19+
20+
TAG=$1
21+
22+
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
23+
cd "$THIS_DIR"
24+
cd ../
25+
26+
function usage() {
27+
echo "=== useage ===================="
28+
echo "Download precompiled xcframework from github,The usage is as follows:"
29+
echo "$0 [<release tag>]"
30+
}
31+
32+
function download() {
33+
local oname="build/pre/${TAG}.xcf"
34+
if [[ -f "$oname" ]];then
35+
echo "$oname already exist,no need download."
36+
return
37+
fi
38+
39+
local fname="$LIB_NAME-apple-xcframework-$VER.zip"
40+
local url="https://github.com/debugly/MRFFToolChainBuildShell/releases/download/$TAG/$fname"
41+
42+
echo "---[download $fname]-----------------"
43+
echo "$url"
44+
mkdir -p build/pre
45+
local tname="build/pre/${TAG}.tmp"
46+
curl -L "$url" -o "$tname"
47+
if [[ $? -eq 0 ]];then
48+
mv "$tname" "$oname"
49+
fi
50+
}
51+
52+
function extract(){
53+
local oname="build/pre/${TAG}.xcf"
54+
55+
if [[ -f "$oname" ]];then
56+
mkdir -p build/product/xcframework
57+
unzip -oq "$oname" -d build/product/xcframework
58+
echo "extract zip file"
59+
if command -v tree >/dev/null 2>&1; then
60+
tree -L 2 build/product/xcframework
61+
fi
62+
else
63+
echo "you need download ${oname} firstly."
64+
exit 1
65+
fi
66+
}
67+
68+
function fix_prefix(){
69+
local plat=$1
70+
local UNI_PC_DIR="build/product/$plat/universal/$LIB_NAME/lib/pkgconfig"
71+
72+
if ls ${UNI_PC_DIR}/*.pc >/dev/null 2>&1;then
73+
echo "fix $plat $LIB_NAME pc file prefix"
74+
p=$(cd "build/product/$plat/universal/$LIB_NAME";pwd)
75+
escaped_p=$(echo $p | sed 's/\//\\\//g')
76+
sed -i "" "s/^prefix=.*/prefix=$escaped_p/" "$UNI_PC_DIR/"*.pc
77+
fi
78+
}
79+
80+
function main(){
81+
download
82+
extract
83+
# fix_prefix "$*"
84+
}
85+
86+
if test -z $TAG ;then
87+
echo "tag can't be nil"
88+
usage
89+
exit
90+
fi
91+
92+
# opus-1.3.1-231124151836
93+
LIB_NAME=$(echo $TAG | awk -F - '{print $1}')
94+
VER=$(echo $TAG | awk -F - '{print $2}')
95+
96+
main

0 commit comments

Comments
 (0)