Skip to content

Commit 6bec8fd

Browse files
authored
Merge pull request #59 from libxengine/develop
V3.18.0.1001 Merge
2 parents 92334a0 + 5d7b2de commit 6bec8fd

File tree

57 files changed

+613
-336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+613
-336
lines changed

.github/workflows/cppcheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: cpp check workflows
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout main repository code
18+
uses: actions/checkout@v4
19+
with:
20+
ref: 'develop'
21+
22+
- name: Create static_analysis directory
23+
run: mkdir -p static_analysis
24+
25+
- name: Run Cppcheck
26+
run: |
27+
sudo apt-get install -y cppcheck
28+
cppcheck --enable=all --language=c++ --std=c++20 ./XEngine_Source/ --output-file=static_analysis/log.xml --xml
29+
continue-on-error: true
30+
31+
- name: Upload Cppcheck Results
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: cppcheck_results
35+
path: static_analysis/log.xml

.github/workflows/linuxbuild.yml

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

.github/workflows/macbuild.yml

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ name: macos build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
8-
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
912
permissions:
1013
contents: read
1114

@@ -15,6 +18,7 @@ jobs:
1518
matrix:
1619
include:
1720
- os: macos-13
21+
- os: macos-14
1822
runs-on: ${{ matrix.os }}
1923

2024
steps:
@@ -38,14 +42,30 @@ jobs:
3842
- name: brew install
3943
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4044

41-
# 设置依赖库的环境变量
42-
- name: Set up Dependency Environment Variables
45+
- name: Set up Dependency x86_64 Environment
46+
if: matrix.os == 'macos-13'
4347
run: |
4448
cd libxengine
4549
chmod 777 *
4650
./XEngine_LINEnv.sh -i 3
47-
cd ..
48-
#编译
51+
- name: Set up Dependency Arm64 Environment
52+
if: matrix.os == 'macos-14'
53+
run: |
54+
cd libxengine
55+
chmod 777 *
56+
./XEngine_LINEnv.sh -i 0
57+
58+
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)
59+
60+
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip
61+
unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64
62+
cd XEngine_Mac_Arm64
63+
64+
sudo mkdir -p /usr/local/include
65+
sudo mkdir -p /usr/local/lib
66+
sudo cp -rf ./XEngine_Include /usr/local/include
67+
sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \;
68+
4969
- name: make debug
5070
run: |
5171
cd XEngine_Source
@@ -62,3 +82,16 @@ jobs:
6282
run: |
6383
cd XEngine_Release
6484
./XEngine_XStorageApp -t
85+
86+
- name: Upload folder as artifact with mac x64
87+
if: matrix.os == 'macos-13'
88+
uses: actions/upload-artifact@v4
89+
with:
90+
name: XEngine_XStorageApp-x86_64-Mac
91+
path: XEngine_Release/
92+
- name: Upload folder as artifact with mac arm
93+
if: matrix.os == 'macos-14'
94+
uses: actions/upload-artifact@v4
95+
with:
96+
name: XEngine_XStorageApp-Arm64-Mac
97+
path: XEngine_Release/

.github/workflows/msbuild.yml

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,71 @@ name: windows build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
8-
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
11+
912
permissions:
1013
contents: read
1114

1215
jobs:
1316
build:
1417
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.
1618
fail-fast: false
1719
matrix:
1820
configuration: [Debug ,Release]
1921
platform: [x86 ,x64]
2022

21-
runs-on: windows-latest # 最新的 Windows 环境
23+
runs-on: windows-latest
2224

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

30-
# 检出依赖的xengine仓库到指定的xengine目录
3131
- name: Checkout dependency repository (xengine)
3232
uses: actions/checkout@v4
3333
with:
3434
repository: libxengine/libxengine
35-
path: xengine
35+
path: libxengine
3636

3737
- name: sub module checkout (opensource)
3838
run: |
3939
git submodule init
4040
git submodule update
4141
shell: pwsh
4242

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

.github/workflows/release.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: release packet
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# 检出代码并包含标签
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Download ubuntubuild
20+
uses: dawidd6/action-download-artifact@v6
21+
with:
22+
workflow: ubuntubuild.yml
23+
workflow_conclusion: success
24+
check_artifacts: false
25+
skip_unpack: true
26+
if_no_artifact_found: fail
27+
path: ./XRelease/
28+
- name: Download macbuild
29+
uses: dawidd6/action-download-artifact@v6
30+
with:
31+
workflow: macbuild.yml
32+
workflow_conclusion: success
33+
check_artifacts: false
34+
skip_unpack: true
35+
if_no_artifact_found: fail
36+
path: ./XRelease/
37+
- name: Download msbuild
38+
uses: dawidd6/action-download-artifact@v6
39+
with:
40+
workflow: msbuild.yml
41+
workflow_conclusion: success
42+
check_artifacts: false
43+
skip_unpack: true
44+
if_no_artifact_found: fail
45+
path: ./XRelease/
46+
47+
- name: Display structure of downloaded files
48+
run: ls -al ./XRelease/
49+
50+
- name: Get current version and increment X
51+
id: versioning
52+
run: |
53+
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
54+
echo "Latest tag: $latest_tag"
55+
# 提取 X 的值并递增
56+
major=$(echo $latest_tag | cut -d '.' -f 1)
57+
minor=$(echo $latest_tag | cut -d '.' -f 2)
58+
patch=$(echo $latest_tag | cut -d '.' -f 3)
59+
build=$(echo $latest_tag | cut -d '.' -f 4)
60+
61+
new_minor=$((minor + 1))
62+
new_version="$major.$new_minor.$patch.$build"
63+
echo "New version: $new_version"
64+
echo "new_tag=$new_version" >> $GITHUB_OUTPUT
65+
echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT
66+
67+
- name: Create and push new tag
68+
run: |
69+
git tag ${{ steps.versioning.outputs.new_tag }}
70+
git push origin ${{ steps.versioning.outputs.new_tag }}
71+
72+
- name: Generate release notes
73+
run: |
74+
logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %h - %s - %an" --no-merges)
75+
release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/')
76+
echo "$release_notes"
77+
echo "$release_notes" > release_notes.txt
78+
79+
- name: Release
80+
uses: softprops/action-gh-release@v2
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
with:
84+
draft: false
85+
prerelease: false
86+
tag_name: ${{ steps.versioning.outputs.new_tag }}
87+
name: XEngine_Storage ${{ steps.versioning.outputs.new_tag }}
88+
body_path: release_notes.txt
89+
files: ./XRelease/*.zip

0 commit comments

Comments
 (0)