Skip to content

Commit

Permalink
fixed:workflows build
Browse files Browse the repository at this point in the history
  • Loading branch information
xengine-qyt committed Jan 2, 2025
1 parent 3da0b5a commit 942fe15
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 42 deletions.
44 changes: 33 additions & 11 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ name: macos build workflows

on:
push:
branches: [ "develop" ]
branches:
- 'develop'
paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'

permissions:
contents: read
- '.github/**'

jobs:
build:
strategy:
matrix:
include:
- os: macos-13
- os: macos-14
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -30,7 +30,6 @@ jobs:
with:
repository: libxengine/libxengine
path: libxengine
ref: 'master'

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

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
- name: Set up Dependency x86_64 Environment
if: matrix.os == 'macos-13'
run: |
cd libxengine
chmod 777 *
./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: Set up Dependency Arm64 Environment
if: matrix.os == 'macos-14'
run: |
cd libxengine
chmod 777 *
./XEngine_LINEnv.sh -i 0
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)
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip
unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64
cd XEngine_Mac_Arm64
sudo mkdir -p /usr/local/include
sudo mkdir -p /usr/local/lib
sudo cp -rf ./XEngine_Include /usr/local/include
sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \;
- name: make debug
run: |
cd XEngine_Source
Expand All @@ -65,8 +80,15 @@ jobs:
cd XEngine_Release
./XEngine_ProxyServiceApp -t
- name: Upload folder as artifact with mac
- name: Upload folder as artifact with mac x64
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
with:
name: XEngine_ProxyServiceApp-x86_64-Mac
path: XEngine_Release/
- name: Upload folder as artifact with mac arm
if: matrix.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: XEngine_ProxyServiceApp-x64-Mac
name: XEngine_ProxyServiceApp-Arm64-Mac
path: XEngine_Release/
46 changes: 28 additions & 18 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@ name: windows build workflows

on:
push:
branches: [ "develop" ]
branches:
- 'develop'
paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'
permissions:
contents: read
- '.github/**'

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]
Expand All @@ -32,29 +31,41 @@ jobs:
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: xengine
path: libxengine

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

# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
- name: Set up Dependency x86_64 Environment
if: matrix.platform == 'x64'
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
echo "XENGINE_INCLUDE=${{ github.workspace }}/libxengine" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: pwsh
- name: Set up Dependency x86_32 Environment
if: matrix.platform == 'x86'
run: |
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
$latest_tag = $response.tag_name
Write-Host "Latest Tag: $latest_tag"
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force

echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | 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: |
Expand All @@ -74,18 +85,17 @@ jobs:
cd XEngine_Release
./VSCopy_x64.bat
shell: pwsh

#将文件夹打包为 artifact

- name: Upload folder as artifact with x86
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
uses: actions/upload-artifact@v4
with:
name: XEngine_ProxyServiceApp-x86-Windows
name: XEngine_ProxyServiceApp-x86_32-Windows
path: XEngine_Release/

- name: Upload folder as artifact with x64
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
uses: actions/upload-artifact@v4
with:
name: XEngine_ProxyServiceApp-x64-Windows
name: XEngine_ProxyServiceApp-x86_64-Windows
path: XEngine_Release/
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
ref: 'develop'
fetch-depth: 0

- name: Download linuxbuild
- name: Download ubuntubuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: linuxbuild.yml
workflow: ubuntubuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,21 @@ name: ubuntu build workflows

on:
push:
branches: [ "develop" ]
branches:
- 'develop'
paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'
permissions:
contents: read
- '.github/**'

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
- os: ubuntu-24.04
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -39,14 +38,28 @@ jobs:
git submodule init
git submodule update
# 设置依赖库的环境变量
- name: Set up Dependency Environment Variables
- name: Set up Dependency ubuntu24.04 Environment
if: matrix.os == 'ubuntu-24.04'
run: |
cd libxengine
chmod 777 *
sudo ./XEngine_LINEnv.sh -i 3
cd ..
#编译
- name: Set up Dependency ubuntu22.04 Environment
if: matrix.os == 'ubuntu-22.04'
run: |
cd libxengine
chmod 777 *
sudo ./XEngine_LINEnv.sh -i 0
latest_tag=$(curl -s https://api.github.com/repos/libxengine/libxengine/releases/latest | jq -r .tag_name)
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_UBuntu_22.04_x86-64.zip
unzip ./XEngine_UBuntu_22.04_x86-64.zip -d ./XEngine_UBuntu_22.04_x86-64
cd XEngine_UBuntu_22.04_x86-64
sudo cp -rf ./XEngine_Include /usr/local/include
sudo find ./XEngine_Linux -name "*.so" -exec cp {} /usr/local/lib \;
sudo ldconfig
- name: make
run: |
cd XEngine_Source
Expand All @@ -63,8 +76,15 @@ jobs:
cd XEngine_Release
./XEngine_ProxyServiceApp -t
- name: Upload folder as artifact with ubuntu
- name: Upload folder as artifact with ubuntu22.04
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: XEngine_ProxyServiceApp-x86_64-Ubuntu-22.04
path: XEngine_Release/
- name: Upload folder as artifact with ubuntu24.04
if: matrix.os == 'ubuntu-24.04'
uses: actions/upload-artifact@v4
with:
name: XEngine_ProxyServiceApp-x64-Ubuntu
name: XEngine_ProxyServiceApp-x86_64-Ubuntu-24.04
path: XEngine_Release/

0 comments on commit 942fe15

Please sign in to comment.