Skip to content

Commit e7340f2

Browse files
committed
添加 CI/CD 构建
1 parent c734004 commit e7340f2

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.github/script/build_ijk_ios.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/bin/sh
2+
#set -eo pipefail
3+
set -e
4+
5+
#rtt=$GIT_BRANCH_IMAGE_VERSION
6+
#rb=$(git rev-parse --abbrev-ref HEAD)
7+
rc=$(git rev-parse --short HEAD)
8+
currtag=$(git describe --tags `git rev-list --tags --max-count=1`)
9+
echo 000---$currtag
10+
11+
./init-ios.sh
12+
./init-ios-openssl.sh
13+
14+
# 1.准备编译
15+
cd ios
16+
17+
#2. 开始编译支持https
18+
./compile-openssl.sh clean
19+
./compile-ffmpeg.sh clean
20+
21+
./compile-openssl.sh arm64
22+
./compile-ffmpeg.sh arm64
23+
24+
cd IJKMediaPlayer
25+
26+
27+
# 2.编译iOS平台工程配置
28+
xcodebuild build -project IJKMediaPlayer.xcodeproj -scheme IJKMediaFramework -configuration Release -sdk iphoneos -derivedDataPath ./build
29+
30+
31+
32+
#3.将编译的结果pod发布
33+
git clone https://$GIT_ACCESS_TOKEN@github.com/tencentyun/iot-thirdparty-ios.git
34+
cd iot-thirdparty-ios
35+
36+
37+
rm -rf Source/IJKPlayer-iOS/IJKMediaFramework.framework
38+
mv ../build/Build/Products/Release-iphoneos/IJKMediaFramework.framework Source/IJKPlayer-iOS
39+
40+
41+
poddatetime=$(date '+%Y%m%d%H%M')
42+
echo $poddatetime
43+
44+
git add .
45+
git commit -m "tencentyun/iot-ijkplayer@$rc"
46+
git push https://$GIT_ACCESS_TOKEN@github.com/tencentyun/iot-thirdparty-ios.git
47+
48+
# ==========此处添加版本自增逻辑,如果是持续集成发snapshot,最新tag+1;如果是发布就发branch
49+
50+
temptag=$(git describe --tags `git rev-list --tags --max-count=1`)
51+
vtaglist=(${temptag//-/ })
52+
beta=${vtaglist[1]}
53+
version=${vtaglist[0]}
54+
resultvv=${version#*v}
55+
echo "-->>$resultvv"
56+
57+
if [ $1 == 'Debug' ]; then
58+
git tag "$resultvv-beta.$poddatetime"
59+
else
60+
vtag=${currtag#*v}
61+
git tag "$vtag"
62+
fi
63+
# ==========此处添加版本自增逻辑,如果是持续集成发snapshot,最新tag+1;如果是发布就发branch
64+
65+
git push https://$GIT_ACCESS_TOKEN@github.com/tencentyun/iot-thirdparty-ios.git --tags

.github/workflows/pushevent.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: iOS XP2P CI
2+
3+
on:
4+
push:
5+
paths-ignore: # 有時候不想要改個文档也触发 github actions
6+
- '**.md'
7+
- 'LICENSE'
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: macos-10.15
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
18+
- name: build libenet
19+
if: startsWith(github.event.ref, 'refs/heads')
20+
run: |
21+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
22+
export GIT_BRANCH_IMAGE_VERSION=$VERSION
23+
sh .github/script/build_enet_ios.sh Debug
24+
env:
25+
GIT_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }}
26+
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }}
27+
28+
- name: push libenet
29+
if: startsWith(github.event.ref, 'refs/tags')
30+
run: |
31+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
32+
export GIT_BRANCH_IMAGE_VERSION=$VERSION
33+
sh .github/script/build_enet_ios.sh Release
34+
env:
35+
GIT_ACCESS_TOKEN: ${{ secrets.IOT_GITHUB_ACCESS_TOKEN }}
36+
PROVISIONING_PASSWORD: ${{ secrets.GPG_DECRYPT_PASSPHRASE }}
37+
38+
- name: Upload NETSDK Library
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: libenet_ios.a
42+
path: iot-p2p/build/ios/Release-iphoneos/libenet.a

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ android/ffmpeg-*
55
android/openssl-*
66
ios/ffmpeg-*
77
ios/openssl-*
8+
ios/IJKMediaPlayer/iot-thirdparty-ios
89
extra
910
.DS_Store
1011
ijkmedia/ijkyuv/

0 commit comments

Comments
 (0)