Skip to content

Commit 82211e5

Browse files
authored
Merge pull request #20 from libxengine/develop
workflow merge
2 parents 5dd14e9 + 70252b1 commit 82211e5

File tree

16 files changed

+280
-18
lines changed

16 files changed

+280
-18
lines changed

.github/workflows/linuxbuild.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
# 设置依赖库的环境变量
43+
- name: Set up Dependency Environment Variables
44+
run: |
45+
cd libxengine
46+
chmod 777 *
47+
sudo ./XEngine_LINEnv.sh -i 3
48+
cd ..
49+
#编译
50+
- name: make
51+
run: |
52+
cd XEngine_Source
53+
make
54+
make FLAGS=InstallAll
55+
make FLAGS=CleanAll
56+
57+
make RELEASE=1
58+
make FLAGS=InstallAll
59+
make FLAGS=CleanAll
60+
cd ..
61+
- name: test
62+
run: |
63+
cd XEngine_Release
64+
./XEngine_ProxyServiceApp -t

.github/workflows/macbuild.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
# 设置依赖库的环境变量
42+
- name: Set up Dependency Environment Variables
43+
run: |
44+
cd libxengine
45+
chmod 777 *
46+
./XEngine_LINEnv.sh -i 3
47+
cd ..
48+
#编译
49+
- name: make debug
50+
run: |
51+
cd XEngine_Source
52+
make PLATFORM=mac
53+
make PLATFORM=mac FLAGS=InstallAll
54+
make PLATFORM=mac FLAGS=CleanAll
55+
- name: make release
56+
run: |
57+
cd XEngine_Source
58+
make PLATFORM=mac RELEASE=1
59+
make PLATFORM=mac FLAGS=InstallAll
60+
make PLATFORM=mac FLAGS=CleanAll
61+
- name: test
62+
run: |
63+
cd XEngine_Release
64+
./XEngine_ProxyServiceApp -t

.github/workflows/msbuild.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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: xengine
36+
37+
- name: sub module checkout (opensource)
38+
run: |
39+
git submodule init
40+
git submodule update
41+
shell: pwsh
42+
43+
# 设置依赖库的环境变量
44+
- name: Set up Dependency Environment Variables
45+
run: |
46+
echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append
47+
echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
48+
echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
49+
shell: pwsh
50+
51+
# 配置 MSBuild 的路径,准备构建 VC++ 项目
52+
- name: Setup MSBuild
53+
uses: microsoft/setup-msbuild@v2
54+
#编译
55+
- name: Build Solution
56+
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
57+
#测试
58+
- name: Conditional Step for x86 Release
59+
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
60+
run: |
61+
cp -r XEngine_Source/Release/*.dll XEngine_Release/
62+
cp -r XEngine_Source/Release/*.exe XEngine_Release/
63+
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
64+
cd XEngine_Release
65+
./VSCopy_x86.bat
66+
./XEngine_ServiceApp.exe -t
67+
shell: pwsh
68+
- name: Conditional Step for x86 Debug
69+
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
70+
run: |
71+
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
72+
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
73+
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
74+
cd XEngine_Release
75+
./VSCopy_x86.bat
76+
./XEngine_ServiceApp.exe -t
77+
shell: pwsh

XEngine_Source/Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ MODULE_PROTOCOL_PATH = ./XEngine_ModuleProtocol
1111
MODULE_SESSION_PATH = ./XEngine_ModuleSession
1212
APP_SERVICE_PATH = ./XEngine_ServiceApp
1313

14+
ifeq ($(PLATFORM),linux)
15+
FILEEXT = so
16+
else ifeq ($(PLATFORM),mac)
17+
FILEEXT = dylib
18+
endif
19+
1420
XENGINE_MODULES = libjsoncpp.so libXEngine_InfoReport.so \
1521
libXEngine_ModuleConfigure.so libXEngine_ModuleProtocol.so libXEngine_ModuleSession.so \
1622
XEngine_ServiceApp.exe
@@ -19,10 +25,17 @@ XENGINE_MODULES = libjsoncpp.so libXEngine_InfoReport.so \
1925
MakeAll:$(XENGINE_MODULES)
2026

2127
libjsoncpp.so:
28+
ifeq ($(FLAGS), InstallAll)
29+
cp $(THIRDPART_MODULE_JSONCPP)/libjsoncpp.$(FILEEXT) ../XEngine_Release/
30+
else
2231
make -C $(THIRDPART_MODULE_JSONCPP) PLATFORM=$(PLATFORM) $(FLAGS)
32+
endif
2333
libXEngine_InfoReport.so:
34+
ifeq ($(FLAGS), InstallAll)
35+
cp $(THIRDPART_MODULE_REPORT)/libXEngine_InfoReport.$(FILEEXT) ../XEngine_Release/
36+
else
2437
make -C $(THIRDPART_MODULE_REPORT) PLATFORM=$(PLATFORM) $(FLAGS)
25-
38+
endif
2639
libXEngine_ModuleConfigure.so:
2740
make -C $(MODULE_CONFIGURE_PATH) PLATFORM=$(PLATFORM) $(FLAGS)
2841
libXEngine_ModuleProtocol.so:

XEngine_Source/XEngine_ModuleAuthorize/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ ifeq ($(RELEASE),1)
1616
FLAGS = -c
1717
DEBUG =
1818
else
19-
FLAGS = -c -lc_p
20-
DEBUG = -g -pg
19+
ifeq ($(PLATFORM),mac)
20+
FLAGS = -c
21+
DEBUG = -g
22+
else
23+
FLAGS = -c -lc_p
24+
DEBUG = -g -pg
25+
endif
2126
endif
2227

2328
ifeq ($(UNICODE),1)

XEngine_Source/XEngine_ModuleConfigure/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ ifeq ($(RELEASE),1)
1616
FLAGS = -c
1717
DEBUG =
1818
else
19-
FLAGS = -c -lc_p
20-
DEBUG = -g -pg
19+
ifeq ($(PLATFORM),mac)
20+
FLAGS = -c
21+
DEBUG = -g
22+
else
23+
FLAGS = -c -lc_p
24+
DEBUG = -g -pg
25+
endif
2126
endif
2227

2328
ifeq ($(UNICODE),1)

0 commit comments

Comments
 (0)