Skip to content

Commit 19112f3

Browse files
committed
update:linux ci modify to ubuntu
update:xengine v9 workflows support
1 parent d3f8cec commit 19112f3

File tree

4 files changed

+169
-88
lines changed

4 files changed

+169
-88
lines changed

.github/workflows/linuxbuild.yml

Lines changed: 0 additions & 64 deletions
This file was deleted.

.github/workflows/macbuild.yml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: macos build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
5+
branches:
6+
- 'develop'
87

98
permissions:
109
contents: read
@@ -15,6 +14,7 @@ jobs:
1514
matrix:
1615
include:
1716
- os: macos-13
17+
- os: macos-14
1818
runs-on: ${{ matrix.os }}
1919

2020
steps:
@@ -38,14 +38,30 @@ jobs:
3838
- name: brew install
3939
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4040

41-
# 设置依赖库的环境变量
42-
- name: Set up Dependency Environment Variables
41+
- name: Set up Dependency x86_64 Environment
42+
if: matrix.os == 'macos-13'
4343
run: |
4444
cd libxengine
4545
chmod 777 *
4646
./XEngine_LINEnv.sh -i 3
47-
cd ..
48-
#编译
47+
- name: Set up Dependency Arm64 Environment
48+
if: matrix.os == 'macos-14'
49+
run: |
50+
cd libxengine
51+
chmod 777 *
52+
./XEngine_LINEnv.sh -i 0
53+
54+
latest_tag=$(git ls-remote --tags --sort="v:refname" https://github.com/libxengine/libxengine.git | awk '{print $2}' | sed 's/refs\/tags\///' | tail -n 1)
55+
56+
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip
57+
unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64
58+
cd XEngine_Mac_Arm64
59+
60+
sudo mkdir -p /usr/local/include
61+
sudo mkdir -p /usr/local/lib
62+
sudo cp -rf ./XEngine_Include /usr/local/include
63+
sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \;
64+
4965
- name: make debug
5066
run: |
5167
cd XEngine_Source
@@ -62,3 +78,16 @@ jobs:
6278
run: |
6379
cd XEngine_Release
6480
./XEngine_XStorageApp -t
81+
82+
- name: Upload folder as artifact with mac x64
83+
if: matrix.os == 'macos-13'
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: XEngine_XStorageApp-x86_64-Mac
87+
path: XEngine_Release/
88+
- name: Upload folder as artifact with mac arm
89+
if: matrix.os == 'macos-14'
90+
uses: actions/upload-artifact@v4
91+
with:
92+
name: XEngine_XStorageApp-Arm64-Mac
93+
path: XEngine_Release/

.github/workflows/msbuild.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,28 @@ name: windows build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
5+
branches:
6+
- 'develop'
87

98
permissions:
109
contents: read
1110

1211
jobs:
1312
build:
1413
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.
1614
fail-fast: false
1715
matrix:
1816
configuration: [Debug ,Release]
1917
platform: [x86 ,x64]
2018

21-
runs-on: windows-latest # 最新的 Windows 环境
19+
runs-on: windows-latest
2220

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

30-
# 检出依赖的xengine仓库到指定的xengine目录
3127
- name: Checkout dependency repository (xengine)
3228
uses: actions/checkout@v4
3329
with:
@@ -40,21 +36,33 @@ jobs:
4036
git submodule update
4137
shell: pwsh
4238

43-
# 设置依赖库的环境变量
44-
- name: Set up Dependency Environment Variables
39+
- name: Set up Dependency x86_64 Environment
40+
if: matrix.platform == 'x64'
4541
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
42+
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
43+
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
4944
shell: pwsh
50-
51-
# 配置 MSBuild 的路径,准备构建 VC++ 项目
45+
- name: Set up Dependency x86_32 Environment
46+
if: matrix.platform == 'x86'
47+
run: |
48+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
49+
$latest_tag = $response.tag_name
50+
Write-Host "Latest Tag: $latest_tag"
51+
52+
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
53+
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
54+
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
55+
56+
echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
57+
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
58+
shell: pwsh
59+
5260
- name: Setup MSBuild
53-
uses: microsoft/setup-msbuild@v1.0.2
54-
#编译
61+
uses: microsoft/setup-msbuild@v2
62+
5563
- name: Build Solution
5664
run: msbuild XEngine_Source/XEngine_StorageApp.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
57-
#测试
65+
5866
- name: Conditional Step for x86 Release
5967
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
6068
run: |
@@ -75,3 +83,17 @@ jobs:
7583
./VSCopy_x86.bat
7684
./XEngine_StorageApp.exe -t
7785
shell: pwsh
86+
87+
- name: Upload folder as artifact with x86
88+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: XEngine_StorageApp-x86_32-Windows
92+
path: XEngine_Release/
93+
94+
- name: Upload folder as artifact with x64
95+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: XEngine_StorageApp-x86_64-Windows
99+
path: XEngine_Release/

.github/workflows/ubuntubuild.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: ubuntu build workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
strategy:
18+
# 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.
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: ubuntu-22.04
23+
- os: ubuntu-24.04
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
# 检出您的主仓库代码
28+
- name: Checkout main repository code
29+
uses: actions/checkout@v4
30+
with:
31+
ref: 'develop'
32+
33+
# 检出依赖的xengine仓库到指定的xengine目录
34+
- name: Checkout dependency repository (xengine)
35+
uses: actions/checkout@v4
36+
with:
37+
repository: libxengine/libxengine
38+
path: libxengine
39+
40+
- name: sub module checkout (opensource)
41+
run: |
42+
git submodule init
43+
git submodule update
44+
45+
- name: Set up Dependency ubuntu24.04 Environment
46+
if: matrix.os == 'ubuntu-24.04'
47+
run: |
48+
cd libxengine
49+
chmod 777 *
50+
sudo ./XEngine_LINEnv.sh -i 3
51+
- name: Set up Dependency ubuntu22.04 Environment
52+
if: matrix.os == 'ubuntu-22.04'
53+
run: |
54+
cd libxengine
55+
chmod 777 *
56+
sudo ./XEngine_LINEnv.sh -i 0
57+
58+
latest_tag=$(curl -s https://api.github.com/repos/libxengine/libxengine/releases/latest | jq -r .tag_name)
59+
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_UBuntu_22.04_x86-64.zip
60+
unzip ./XEngine_UBuntu_22.04_x86-64.zip -d ./XEngine_UBuntu_22.04_x86-64
61+
cd XEngine_UBuntu_22.04_x86-64
62+
63+
sudo cp -rf ./XEngine_Include /usr/local/include
64+
sudo find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \;
65+
sudo ldconfig
66+
67+
- name: make
68+
run: |
69+
cd XEngine_Source
70+
make
71+
make FLAGS=InstallAll
72+
make FLAGS=CleanAll
73+
74+
make RELEASE=1
75+
make FLAGS=InstallAll
76+
make FLAGS=CleanAll
77+
cd ..
78+
- name: test
79+
run: |
80+
cd XEngine_Release
81+
./XEngine_XStorageApp -t
82+
83+
- name: Upload folder as artifact with ubuntu22.04
84+
if: matrix.os == 'ubuntu-22.04'
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: XEngine_XStorageApp-x86_64-Ubuntu-22.04
88+
path: XEngine_Release/
89+
- name: Upload folder as artifact with ubuntu24.04
90+
if: matrix.os == 'ubuntu-24.04'
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: XEngine_XStorageApp-x86_64-Ubuntu-24.04
94+
path: XEngine_Release/

0 commit comments

Comments
 (0)