Skip to content

Commit

Permalink
added:workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
xengine-qyt committed Sep 27, 2024
1 parent 1ff55ba commit fd5ff72
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/linuxbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: ubuntu build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
# 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.
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
#- os: ubuntu-24.04
runs-on: ${{ matrix.os }}

steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
- name: install library
run: sudo apt install libsrt-gnutls-dev libsrtp2-dev -y

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
cd libxengine
chmod 777 *
sudo ./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: make
run: |
cd XEngine_Source
make
make FLAGS=InstallAll
make FLAGS=CleanAll
make RELEASE=1
make FLAGS=InstallAll
make FLAGS=CleanAll
cd ..
- name: test
run: |
cd XEngine_Release
./XEngine_StreamMediaApp -t
67 changes: 67 additions & 0 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: macos build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
matrix:
include:
- os: macos-13
runs-on: ${{ matrix.os }}

steps:
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
- name: brew install
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

- name: install library
run: brew install srt-devel srtp2-devel

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
cd libxengine
chmod 777 *
./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: make debug
run: |
cd XEngine_Source
make PLATFORM=mac
make PLATFORM=mac FLAGS=InstallAll
make PLATFORM=mac FLAGS=CleanAll
- name: make release
run: |
cd XEngine_Source
make PLATFORM=mac RELEASE=1
make PLATFORM=mac FLAGS=InstallAll
make PLATFORM=mac FLAGS=CleanAll
- name: test
run: |
cd XEngine_Release
./XEngine_StreamMediaApp -t
102 changes: 102 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: windows build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]

permissions:
contents: read

jobs:
build:
strategy:
# 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.
fail-fast: false
matrix:
configuration: [Debug ,Release]
platform: [x86 ,x64]

runs-on: windows-latest # 最新的 Windows 环境

steps:
# 检出您的主仓库代码
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
shell: pwsh

- name: vcpkg dependency repository
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
path: vcpkg

- name: vcpkg install (x86)
if: matrix.platform == 'x86'
run: |
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg.exe install libsrt:x86-windows libsrtp:x86-windows
./vcpkg.exe integrate install
shell: pwsh
- name: vcpkg install (x64)
if: matrix.platform == 'x64'
run: |
cd vcpkg
./bootstrap-vcpkg.bat
./vcpkg.exe install libsrt:x64-windows libsrtp:x64-windows
./vcpkg.exe integrate install
shell: pwsh

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
run: |
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB32=${{ github.workspace }}/libxengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- name: Set code page
run: chcp 65001

# 配置 MSBuild 的路径,准备构建 VC++ 项目
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
#编译
- name: Build Solution
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:AdditionalOptions="/utf-8"
#测试
- name: Conditional Step for x86 Release
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Release/*.dll XEngine_Release/
cp -r XEngine_Source/Release/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_StreamMediaApp.exe -t
shell: pwsh
- name: Conditional Step for x86 Debug
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
run: |
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
cd XEngine_Release
./VSCopy_x86.bat
./XEngine_StreamMediaApp.exe -t
shell: pwsh

0 comments on commit fd5ff72

Please sign in to comment.