Skip to content

Commit

Permalink
update:linux ci modify to ubuntu
Browse files Browse the repository at this point in the history
update:xengine v9 workflows support
  • Loading branch information
xengine-qyt committed Dec 30, 2024
1 parent d3f8cec commit 19112f3
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 88 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/linuxbuild.yml

This file was deleted.

43 changes: 36 additions & 7 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ name: macos build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
branches:
- 'develop'

permissions:
contents: read
Expand All @@ -15,6 +14,7 @@ jobs:
matrix:
include:
- os: macos-13
- os: macos-14
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -38,14 +38,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 @@ -62,3 +78,16 @@ jobs:
run: |
cd XEngine_Release
./XEngine_XStorageApp -t
- name: Upload folder as artifact with mac x64
if: matrix.os == 'macos-13'
uses: actions/upload-artifact@v4
with:
name: XEngine_XStorageApp-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_XStorageApp-Arm64-Mac
path: XEngine_Release/
56 changes: 39 additions & 17 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,28 @@ name: windows build workflows

on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
branches:
- 'develop'

permissions:
contents: read

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]
platform: [x86 ,x64]

runs-on: windows-latest # 最新的 Windows 环境
runs-on: windows-latest

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

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
Expand All @@ -40,21 +36,33 @@ jobs:
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

# 配置 MSBuild 的路径,准备构建 VC++ 项目
- 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

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
#编译
uses: microsoft/setup-msbuild@v2

- name: Build Solution
run: msbuild XEngine_Source/XEngine_StorageApp.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 @@ -75,3 +83,17 @@ jobs:
./VSCopy_x86.bat
./XEngine_StorageApp.exe -t
shell: pwsh

- name: Upload folder as artifact with x86
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
uses: actions/upload-artifact@v4
with:
name: XEngine_StorageApp-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_StorageApp-x86_64-Windows
path: XEngine_Release/
94 changes: 94 additions & 0 deletions .github/workflows/ubuntubuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: ubuntu build workflows

on:
push:
branches:
- 'develop'
paths:
- 'XEngine_Source/**'
- 'XEngine_Release/**'
- '.github/**'

permissions:
contents: read

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

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

# 检出依赖的xengine仓库到指定的xengine目录
- name: Checkout dependency repository (xengine)
uses: actions/checkout@v4
with:
repository: libxengine/libxengine
path: libxengine

- name: sub module checkout (opensource)
run: |
git submodule init
git submodule update
- name: Set up Dependency ubuntu24.04 Environment
if: matrix.os == 'ubuntu-24.04'
run: |
cd libxengine
chmod 777 *
sudo ./XEngine_LINEnv.sh -i 3
- 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
make
make FLAGS=InstallAll
make FLAGS=CleanAll
make RELEASE=1
make FLAGS=InstallAll
make FLAGS=CleanAll
cd ..
- name: test
run: |
cd XEngine_Release
./XEngine_XStorageApp -t
- name: Upload folder as artifact with ubuntu22.04
if: matrix.os == 'ubuntu-22.04'
uses: actions/upload-artifact@v4
with:
name: XEngine_XStorageApp-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_XStorageApp-x86_64-Ubuntu-24.04
path: XEngine_Release/

0 comments on commit 19112f3

Please sign in to comment.