Skip to content

Commit fd5ff72

Browse files
committed
added:workflows
1 parent 1ff55ba commit fd5ff72

File tree

3 files changed

+236
-0
lines changed

3 files changed

+236
-0
lines changed

.github/workflows/linuxbuild.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: ubuntu build workflows
2+
3+
on:
4+
push:
5+
branches: [ "develop" ]
6+
pull_request:
7+
branches: [ "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
strategy:
15+
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: ubuntu-22.04
20+
#- os: ubuntu-24.04
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
# 检出您的主仓库代码
25+
- name: Checkout main repository code
26+
uses: actions/checkout@v4
27+
with:
28+
ref: 'develop'
29+
30+
# 检出依赖的xengine仓库到指定的xengine目录
31+
- name: Checkout dependency repository (xengine)
32+
uses: actions/checkout@v4
33+
with:
34+
repository: libxengine/libxengine
35+
path: libxengine
36+
37+
- name: sub module checkout (opensource)
38+
run: |
39+
git submodule init
40+
git submodule update
41+
42+
- name: install library
43+
run: sudo apt install libsrt-gnutls-dev libsrtp2-dev -y
44+
45+
# 设置依赖库的环境变量
46+
- name: Set up Dependency Environment Variables
47+
run: |
48+
cd libxengine
49+
chmod 777 *
50+
sudo ./XEngine_LINEnv.sh -i 3
51+
cd ..
52+
#编译
53+
- name: make
54+
run: |
55+
cd XEngine_Source
56+
make
57+
make FLAGS=InstallAll
58+
make FLAGS=CleanAll
59+
60+
make RELEASE=1
61+
make FLAGS=InstallAll
62+
make FLAGS=CleanAll
63+
cd ..
64+
- name: test
65+
run: |
66+
cd XEngine_Release
67+
./XEngine_StreamMediaApp -t

.github/workflows/macbuild.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: macos build workflows
2+
3+
on:
4+
push:
5+
branches: [ "develop" ]
6+
pull_request:
7+
branches: [ "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
strategy:
15+
matrix:
16+
include:
17+
- os: macos-13
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Checkout main repository code
22+
uses: actions/checkout@v4
23+
with:
24+
ref: 'develop'
25+
26+
# 检出依赖的xengine仓库到指定的xengine目录
27+
- name: Checkout dependency repository (xengine)
28+
uses: actions/checkout@v4
29+
with:
30+
repository: libxengine/libxengine
31+
path: libxengine
32+
33+
- name: sub module checkout (opensource)
34+
run: |
35+
git submodule init
36+
git submodule update
37+
38+
- name: brew install
39+
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
40+
41+
- name: install library
42+
run: brew install srt-devel srtp2-devel
43+
44+
# 设置依赖库的环境变量
45+
- name: Set up Dependency Environment Variables
46+
run: |
47+
cd libxengine
48+
chmod 777 *
49+
./XEngine_LINEnv.sh -i 3
50+
cd ..
51+
#编译
52+
- name: make debug
53+
run: |
54+
cd XEngine_Source
55+
make PLATFORM=mac
56+
make PLATFORM=mac FLAGS=InstallAll
57+
make PLATFORM=mac FLAGS=CleanAll
58+
- name: make release
59+
run: |
60+
cd XEngine_Source
61+
make PLATFORM=mac RELEASE=1
62+
make PLATFORM=mac FLAGS=InstallAll
63+
make PLATFORM=mac FLAGS=CleanAll
64+
- name: test
65+
run: |
66+
cd XEngine_Release
67+
./XEngine_StreamMediaApp -t

.github/workflows/msbuild.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: windows build workflows
2+
3+
on:
4+
push:
5+
branches: [ "develop" ]
6+
pull_request:
7+
branches: [ "develop" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
strategy:
15+
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
16+
fail-fast: false
17+
matrix:
18+
configuration: [Debug ,Release]
19+
platform: [x86 ,x64]
20+
21+
runs-on: windows-latest # 最新的 Windows 环境
22+
23+
steps:
24+
# 检出您的主仓库代码
25+
- name: Checkout main repository code
26+
uses: actions/checkout@v4
27+
with:
28+
ref: 'develop'
29+
30+
# 检出依赖的xengine仓库到指定的xengine目录
31+
- name: Checkout dependency repository (xengine)
32+
uses: actions/checkout@v4
33+
with:
34+
repository: libxengine/libxengine
35+
path: libxengine
36+
37+
- name: sub module checkout (opensource)
38+
run: |
39+
git submodule init
40+
git submodule update
41+
shell: pwsh
42+
43+
- name: vcpkg dependency repository
44+
uses: actions/checkout@v4
45+
with:
46+
repository: microsoft/vcpkg
47+
path: vcpkg
48+
49+
- name: vcpkg install (x86)
50+
if: matrix.platform == 'x86'
51+
run: |
52+
cd vcpkg
53+
./bootstrap-vcpkg.bat
54+
./vcpkg.exe install libsrt:x86-windows libsrtp:x86-windows
55+
./vcpkg.exe integrate install
56+
shell: pwsh
57+
- name: vcpkg install (x64)
58+
if: matrix.platform == 'x64'
59+
run: |
60+
cd vcpkg
61+
./bootstrap-vcpkg.bat
62+
./vcpkg.exe install libsrt:x64-windows libsrtp:x64-windows
63+
./vcpkg.exe integrate install
64+
shell: pwsh
65+
66+
# 设置依赖库的环境变量
67+
- name: Set up Dependency Environment Variables
68+
run: |
69+
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
70+
echo "XENGINE_LIB32=${{ github.workspace }}/libxengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
71+
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
72+
shell: pwsh
73+
- name: Set code page
74+
run: chcp 65001
75+
76+
# 配置 MSBuild 的路径,准备构建 VC++ 项目
77+
- name: Setup MSBuild
78+
uses: microsoft/setup-msbuild@v2
79+
#编译
80+
- name: Build Solution
81+
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:AdditionalOptions="/utf-8"
82+
#测试
83+
- name: Conditional Step for x86 Release
84+
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
85+
run: |
86+
cp -r XEngine_Source/Release/*.dll XEngine_Release/
87+
cp -r XEngine_Source/Release/*.exe XEngine_Release/
88+
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
89+
cd XEngine_Release
90+
./VSCopy_x86.bat
91+
./XEngine_StreamMediaApp.exe -t
92+
shell: pwsh
93+
- name: Conditional Step for x86 Debug
94+
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
95+
run: |
96+
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
97+
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
98+
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
99+
cd XEngine_Release
100+
./VSCopy_x86.bat
101+
./XEngine_StreamMediaApp.exe -t
102+
shell: pwsh

0 commit comments

Comments
 (0)