Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: cpp check workflows

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

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout main repository code
uses: actions/checkout@v4
with:
ref: 'develop'

- name: Create static_analysis directory
run: mkdir -p static_analysis

- name: Run Cppcheck
run: |
sudo apt-get install -y cppcheck
cppcheck --enable=all --language=c++ --std=c++20 ./XEngine_Source/ --output-file=static_analysis/log.xml --xml
continue-on-error: true

- name: Upload Cppcheck Results
uses: actions/upload-artifact@v4
with:
name: cppcheck_results
path: static_analysis/log.xml
64 changes: 0 additions & 64 deletions .github/workflows/linuxbuild.yml

This file was deleted.

49 changes: 41 additions & 8 deletions .github/workflows/macbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name: macos build workflows

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

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

permissions:
contents: read

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

steps:
Expand All @@ -38,14 +42,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 +82,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/
64 changes: 45 additions & 19 deletions .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,71 @@ name: windows build workflows

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

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:
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:
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

# 配置 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 +87,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/
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: release packet

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
# 检出代码并包含标签
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download ubuntubuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: ubuntubuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download macbuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: macbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/
- name: Download msbuild
uses: dawidd6/action-download-artifact@v6
with:
workflow: msbuild.yml
workflow_conclusion: success
check_artifacts: false
skip_unpack: true
if_no_artifact_found: fail
path: ./XRelease/

- name: Display structure of downloaded files
run: ls -al ./XRelease/

- name: Get current version and increment X
id: versioning
run: |
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag: $latest_tag"
# 提取 X 的值并递增
major=$(echo $latest_tag | cut -d '.' -f 1)
minor=$(echo $latest_tag | cut -d '.' -f 2)
patch=$(echo $latest_tag | cut -d '.' -f 3)
build=$(echo $latest_tag | cut -d '.' -f 4)

new_minor=$((minor + 1))
new_version="$major.$new_minor.$patch.$build"
echo "New version: $new_version"
echo "new_tag=$new_version" >> $GITHUB_OUTPUT
echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT

- name: Create and push new tag
run: |
git tag ${{ steps.versioning.outputs.new_tag }}
git push origin ${{ steps.versioning.outputs.new_tag }}

- name: Generate release notes
run: |
logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %h - %s - %an" --no-merges)
release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/')
echo "$release_notes"
echo "$release_notes" > release_notes.txt

- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: false
prerelease: false
tag_name: ${{ steps.versioning.outputs.new_tag }}
name: XEngine_Storage ${{ steps.versioning.outputs.new_tag }}
body_path: release_notes.txt
files: ./XRelease/*.zip
Loading
Loading