Skip to content

Commit 1f2fbbc

Browse files
committed
update:workflows.
1 parent 9be47a3 commit 1f2fbbc

File tree

4 files changed

+90
-32
lines changed

4 files changed

+90
-32
lines changed

.github/workflows/macbuild.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: macos build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
5+
branches:
6+
- 'develop'
67
paths:
78
- 'XEngine_Source/**'
89
- 'XEngine_Release/**'
10+
- '.github/**'
911

1012
permissions:
1113
contents: read
@@ -16,6 +18,7 @@ jobs:
1618
matrix:
1719
include:
1820
- os: macos-13
21+
- os: macos-14
1922
runs-on: ${{ matrix.os }}
2023

2124
steps:
@@ -30,7 +33,6 @@ jobs:
3033
with:
3134
repository: libxengine/libxengine
3235
path: libxengine
33-
ref: 'master'
3436

3537
- name: sub module checkout (opensource)
3638
run: |
@@ -40,14 +42,30 @@ jobs:
4042
- name: brew install
4143
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
4244

43-
# 设置依赖库的环境变量
44-
- name: Set up Dependency Environment Variables
45+
- name: Set up Dependency x86_64 Environment
46+
if: matrix.os == 'macos-13'
4547
run: |
4648
cd libxengine
4749
chmod 777 *
4850
./XEngine_LINEnv.sh -i 3
49-
cd ..
50-
#编译
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+
5169
- name: make debug
5270
run: |
5371
cd XEngine_Source
@@ -65,8 +83,15 @@ jobs:
6583
cd XEngine_Release
6684
./XEngine_AuthorizeService -t
6785
68-
- name: Upload folder as artifact with mac
86+
- name: Upload folder as artifact with mac x64
87+
if: matrix.os == 'macos-13'
6988
uses: actions/upload-artifact@v4
7089
with:
7190
name: XEngine_AuthorizeService-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_AuthorizeService-Arm64-Mac
7297
path: XEngine_Release/

.github/workflows/msbuild.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: windows build workflows
33
on:
44
push:
55
branches:
6-
- develop
6+
- 'develop'
77
paths:
88
- 'XEngine_Source/**'
99
- 'XEngine_Release/**'
10+
- '.github/**'
1011

1112
jobs:
1213
build:
1314
strategy:
14-
# 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.
1515
fail-fast: false
1616
matrix:
1717
configuration: [Debug ,Release]
@@ -31,29 +31,41 @@ jobs:
3131
uses: actions/checkout@v4
3232
with:
3333
repository: libxengine/libxengine
34-
path: xengine
34+
path: libxengine
3535

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

42-
# 设置依赖库的环境变量
43-
- name: Set up Dependency Environment Variables
42+
- name: Set up Dependency x86_64 Environment
43+
if: matrix.platform == 'x64'
4444
run: |
45-
echo "XENGINE_INCLUDE=${{ github.workspace }}/xengine" | Out-File -FilePath $env:GITHUB_ENV -Append
46-
echo "XENGINE_LIB32=${{ github.workspace }}/xengine/XEngine_Windows/x86" | Out-File -FilePath $env:GITHUB_ENV -Append
47-
echo "XENGINE_LIB64=${{ github.workspace }}/xengine/XEngine_Windows/x64" | Out-File -FilePath $env:GITHUB_ENV -Append
45+
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
46+
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
47+
shell: pwsh
48+
- name: Set up Dependency x86_32 Environment
49+
if: matrix.platform == 'x86'
50+
run: |
51+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
52+
$latest_tag = $response.tag_name
53+
Write-Host "Latest Tag: $latest_tag"
54+
55+
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
56+
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
57+
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
58+
59+
echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
60+
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
4861
shell: pwsh
4962

50-
# 配置 MSBuild 的路径,准备构建 VC++ 项目
5163
- name: Setup MSBuild
5264
uses: microsoft/setup-msbuild@v2
53-
#编译
65+
5466
- name: Build Solution
5567
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
56-
#测试
68+
5769
- name: Conditional Step for x86 Release
5870
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
5971
run: |
@@ -73,8 +85,7 @@ jobs:
7385
cd XEngine_Release
7486
./VSCopy_x64.bat
7587
shell: pwsh
76-
77-
#将文件夹打包为 artifact
88+
7889
- name: Upload folder as artifact with x86
7990
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
8091
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
with:
1717
fetch-depth: 0
1818

19-
- name: Download linuxbuild
19+
- name: Download ubuntubuild
2020
uses: dawidd6/action-download-artifact@v6
2121
with:
22-
workflow: linuxbuild.yml
22+
workflow: ubuntubuild.yml
2323
workflow_conclusion: success
2424
check_artifacts: false
2525
skip_unpack: true
Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ name: ubuntu build workflows
22

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

@@ -17,17 +20,15 @@ jobs:
1720
matrix:
1821
include:
1922
- os: ubuntu-22.04
20-
#- os: ubuntu-24.04
23+
- os: ubuntu-24.04
2124
runs-on: ${{ matrix.os }}
2225

2326
steps:
24-
# 检出您的主仓库代码
2527
- name: Checkout main repository code
2628
uses: actions/checkout@v4
2729
with:
2830
ref: 'develop'
2931

30-
# 检出依赖的xengine仓库到指定的xengine目录
3132
- name: Checkout dependency repository (xengine)
3233
uses: actions/checkout@v4
3334
with:
@@ -39,14 +40,28 @@ jobs:
3940
git submodule init
4041
git submodule update
4142
42-
# 设置依赖库的环境变量
43-
- name: Set up Dependency Environment Variables
43+
- name: Set up Dependency ubuntu24.04 Environment
44+
if: matrix.os == 'ubuntu-24.04'
4445
run: |
4546
cd libxengine
4647
chmod 777 *
4748
sudo ./XEngine_LINEnv.sh -i 3
48-
cd ..
49-
#编译
49+
- name: Set up Dependency ubuntu22.04 Environment
50+
if: matrix.os == 'ubuntu-22.04'
51+
run: |
52+
cd libxengine
53+
chmod 777 *
54+
sudo ./XEngine_LINEnv.sh -i 0
55+
56+
latest_tag=$(curl -s https://api.github.com/repos/libxengine/libxengine/releases/latest | jq -r .tag_name)
57+
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_UBuntu_22.04_x86-64.zip
58+
unzip ./XEngine_UBuntu_22.04_x86-64.zip -d ./XEngine_UBuntu_22.04_x86-64
59+
cd XEngine_UBuntu_22.04_x86-64
60+
61+
sudo cp -rf ./XEngine_Include /usr/local/include
62+
sudo find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \;
63+
sudo ldconfig
64+
5065
- name: make
5166
run: |
5267
cd XEngine_Source
@@ -63,8 +78,15 @@ jobs:
6378
cd XEngine_Release
6479
./XEngine_AuthorizeService -t
6580
66-
- name: Upload folder as artifact with ubuntu
81+
- name: Upload folder as artifact with ubuntu22.04
82+
if: matrix.os == 'ubuntu-22.04'
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: XEngine_AuthorizeService-x86_64-Ubuntu-22.04
86+
path: XEngine_Release/
87+
- name: Upload folder as artifact with ubuntu24.04
88+
if: matrix.os == 'ubuntu-24.04'
6789
uses: actions/upload-artifact@v4
6890
with:
69-
name: XEngine_AuthorizeService-x86_64-Ubuntu
91+
name: XEngine_AuthorizeService-x86_64-Ubuntu-24.04
7092
path: XEngine_Release/

0 commit comments

Comments
 (0)