Skip to content

workflow merge #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/linuxbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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: 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_ProxyServiceApp -t
64 changes: 64 additions & 0 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
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: 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_ProxyServiceApp -t
77 changes: 77 additions & 0 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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: xengine

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

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

# 配置 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 }}
#测试
- 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_ServiceApp.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_ServiceApp.exe -t
shell: pwsh
15 changes: 14 additions & 1 deletion XEngine_Source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ MODULE_PROTOCOL_PATH = ./XEngine_ModuleProtocol
MODULE_SESSION_PATH = ./XEngine_ModuleSession
APP_SERVICE_PATH = ./XEngine_ServiceApp

ifeq ($(PLATFORM),linux)
FILEEXT = so
else ifeq ($(PLATFORM),mac)
FILEEXT = dylib
endif

XENGINE_MODULES = libjsoncpp.so libXEngine_InfoReport.so \
libXEngine_ModuleConfigure.so libXEngine_ModuleProtocol.so libXEngine_ModuleSession.so \
XEngine_ServiceApp.exe
Expand All @@ -19,10 +25,17 @@ XENGINE_MODULES = libjsoncpp.so libXEngine_InfoReport.so \
MakeAll:$(XENGINE_MODULES)

libjsoncpp.so:
ifeq ($(FLAGS), InstallAll)
cp $(THIRDPART_MODULE_JSONCPP)/libjsoncpp.$(FILEEXT) ../XEngine_Release/
else
make -C $(THIRDPART_MODULE_JSONCPP) PLATFORM=$(PLATFORM) $(FLAGS)
endif
libXEngine_InfoReport.so:
ifeq ($(FLAGS), InstallAll)
cp $(THIRDPART_MODULE_REPORT)/libXEngine_InfoReport.$(FILEEXT) ../XEngine_Release/
else
make -C $(THIRDPART_MODULE_REPORT) PLATFORM=$(PLATFORM) $(FLAGS)

endif
libXEngine_ModuleConfigure.so:
make -C $(MODULE_CONFIGURE_PATH) PLATFORM=$(PLATFORM) $(FLAGS)
libXEngine_ModuleProtocol.so:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions XEngine_Source/XEngine_ModuleAuthorize/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1)
FLAGS = -c
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
ifeq ($(PLATFORM),mac)
FLAGS = -c
DEBUG = -g
else
FLAGS = -c -lc_p
DEBUG = -g -pg
endif
endif

ifeq ($(UNICODE),1)
Expand Down
9 changes: 7 additions & 2 deletions XEngine_Source/XEngine_ModuleConfigure/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1)
FLAGS = -c
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
ifeq ($(PLATFORM),mac)
FLAGS = -c
DEBUG = -g
else
FLAGS = -c -lc_p
DEBUG = -g -pg
endif
endif

ifeq ($(UNICODE),1)
Expand Down
9 changes: 7 additions & 2 deletions XEngine_Source/XEngine_ModuleProtocol/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ ifeq ($(RELEASE),1)
FLAGS = -c
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
ifeq ($(PLATFORM),mac)
FLAGS = -c
DEBUG = -g
else
FLAGS = -c -lc_p
DEBUG = -g -pg
endif
endif

ifeq ($(UNICODE),1)
Expand Down
11 changes: 8 additions & 3 deletions XEngine_Source/XEngine_ModuleSession/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ RELEASE = 0
UNICODE = 0
LOADHDR = -I ./ -I ../XEngine_ThirdPart/jsoncpp
LOADSO =
LIB = -lXEngine_BaseLib
LIB = -lXEngine_BaseLib -lXEngine_Algorithm
LIBEX =
OBJECTS = ModuleSession_Forward.o ModuleSession_Socks.o ModuleSession_Tunnel.o pch.o

ifeq ($(RELEASE),1)
FLAGS = -c
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
ifeq ($(PLATFORM),mac)
FLAGS = -c
DEBUG = -g
else
FLAGS = -c -lc_p
DEBUG = -g -pg
endif
endif

ifeq ($(UNICODE),1)
Expand Down
9 changes: 7 additions & 2 deletions XEngine_Source/XEngine_ServiceApp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ ifeq ($(RELEASE),1)
FLAGS = -c
DEBUG =
else
FLAGS = -c -lc_p
DEBUG = -g -pg
ifeq ($(PLATFORM),mac)
FLAGS = -c
DEBUG = -g
else
FLAGS = -c -lc_p
DEBUG = -g -pg
endif
endif

ifeq ($(UNICODE),1)
Expand Down
4 changes: 4 additions & 0 deletions XEngine_Source/XEngine_ServiceApp/XEngine_Configure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ bool XEngine_Configure_Parament(int argc, char** argv, XENGINE_SERVICECONFIG* pS
printf("Version:%s\n", m_StrVersion.c_str());
return false;
}
else if (0 == _tcsxcmp("-t", argv[i]))
{
bIsTest = true;
}
}

return true;
Expand Down
1 change: 1 addition & 0 deletions XEngine_Source/XEngine_ServiceApp/XEngine_Hdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ using namespace std;
// History:
*********************************************************************/
extern bool bIsRun;
extern bool bIsTest;
extern XHANDLE xhLog;
//Socks服务器
extern XHANDLE xhSocksSocket;
Expand Down
Loading