Skip to content

Commit 11ed90e

Browse files
authored
Merge pull request #35 from libxengine/develop
V3.8 Merge
2 parents 9cae1ac + d29f77d commit 11ed90e

File tree

103 files changed

+1016
-364
lines changed

Some content is hidden

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

103 files changed

+1016
-364
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Issue Translator
2+
on:
3+
issue_comment:
4+
types: [created]
5+
issues:
6+
types: [opened]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: usthe/[email protected]
13+
with:
14+
IS_MODIFY_TITLE: false
15+
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.

.github/workflows/linuxbuild.yml

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

.github/workflows/macbuild.yml

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name: macos build workflows
33
on:
44
push:
55
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
6+
paths:
7+
- 'XEngine_Source/**'
8+
- 'XEngine_Release/**'
9+
- '.github/**'
810

911
permissions:
1012
contents: read
@@ -15,6 +17,7 @@ jobs:
1517
matrix:
1618
include:
1719
- os: macos-13
20+
- os: macos-14
1821
runs-on: ${{ matrix.os }}
1922

2023
steps:
@@ -34,24 +37,35 @@ jobs:
3437
run: |
3538
git submodule init
3639
git submodule update
37-
38-
- name: brew install
39-
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4040
4141
- name: install library
4242
run: |
4343
brew install lua opencv qrencode
44-
brew list opencv
45-
brew info opencv
4644
47-
# 设置依赖库的环境变量
48-
- name: Set up Dependency Environment Variables
45+
- name: Set up Dependency x86_64 Environment
46+
if: matrix.os == 'macos-13'
4947
run: |
5048
cd libxengine
5149
chmod 777 *
5250
./XEngine_LINEnv.sh -i 3
53-
cd ..
54-
#编译
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+
5569
- name: make debug
5670
run: |
5771
cd XEngine_Source
@@ -68,3 +82,16 @@ jobs:
6882
run: |
6983
cd XEngine_Release
7084
./XEngine_APIServiceApp -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_APIServiceApp-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_APIServiceApp-Arm64-Mac
97+
path: XEngine_Release/

.github/workflows/msbuild.yml

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name: windows build workflows
33
on:
44
push:
55
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
6+
paths:
7+
- 'XEngine_Source/**'
8+
- 'XEngine_Release/**'
9+
- '.github/**'
810

911
permissions:
1012
contents: read
@@ -19,7 +21,8 @@ jobs:
1921
platform: [x86 ,x64]
2022

2123
runs-on: windows-latest # 最新的 Windows 环境
22-
24+
env:
25+
ACTIONS_STEP_DEBUG: true
2326
steps:
2427
# 检出您的主仓库代码
2528
- name: Checkout main repository code
@@ -63,22 +66,35 @@ jobs:
6366
./vcpkg.exe integrate install
6467
shell: pwsh
6568

66-
# 设置依赖库的环境变量
67-
- name: Set up Dependency Environment Variables
69+
- name: Set up Dependency x86_64 Environment
70+
if: matrix.platform == 'x64'
6871
run: |
6972
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
70-
echo "XENGINE_LIB32=${{ github.workspace }}/libxengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
71-
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
73+
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
74+
shell: pwsh
75+
- name: Set up Dependency x86_32 Environment
76+
if: matrix.platform == 'x86'
77+
run: |
78+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
79+
$latest_tag = $response.tag_name
80+
Write-Host "Latest Tag: $latest_tag"
81+
82+
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
83+
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
84+
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
85+
86+
echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
87+
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
7288
shell: pwsh
73-
- name: Set code page
74-
run: chcp 65001
7589

7690
# 配置 MSBuild 的路径,准备构建 VC++ 项目
7791
- name: Setup MSBuild
7892
uses: microsoft/setup-msbuild@v2
93+
7994
#编译
8095
- name: Build Solution
81-
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }} /p:AdditionalOptions="/utf-8"
96+
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
97+
8298
#测试
8399
- name: Conditional Step for x86 Release
84100
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
@@ -89,14 +105,26 @@ jobs:
89105
cd XEngine_Release
90106
./VSCopy_x86.bat
91107
./XEngine_HttpApp.exe -t
92-
shell: pwsh
93-
- name: Conditional Step for x86 Debug
94-
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
108+
- name: Conditional Step for x64 Release
109+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
95110
run: |
96-
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
97-
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
98-
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
111+
cp -r XEngine_Source/x64/Release/*.dll XEngine_Release/
112+
cp -r XEngine_Source/x64/Release/*.exe XEngine_Release/
113+
cp -r XEngine_Source/VSCopy_x64.bat XEngine_Release/
99114
cd XEngine_Release
100-
./VSCopy_x86.bat
101-
./XEngine_HttpApp.exe -t
115+
./VSCopy_x64.bat
102116
shell: pwsh
117+
118+
- name: Upload folder as artifact with x86
119+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: XEngine_APIServiceApp-x86_32-Windows
123+
path: XEngine_Release/
124+
125+
- name: Upload folder as artifact with x64
126+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: XEngine_APIServiceApp-x86_64-Windows
130+
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_APIService ${{ steps.versioning.outputs.new_tag }}
88+
body_path: release_notes.txt
89+
files: ./XRelease/*.zip

0 commit comments

Comments
 (0)