Skip to content

Commit fd761f5

Browse files
committed
update:workflows more release support
added:release.yml and issue-translator.yml
1 parent 94d98bb commit fd761f5

File tree

6 files changed

+284
-103
lines changed

6 files changed

+284
-103
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: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ name: macos build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
8-
9-
permissions:
10-
contents: read
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
1111

1212
jobs:
1313
build:
1414
strategy:
1515
matrix:
1616
include:
1717
- os: macos-13
18+
- os: macos-14
1819
runs-on: ${{ matrix.os }}
1920

2021
steps:
@@ -23,7 +24,6 @@ jobs:
2324
with:
2425
ref: 'develop'
2526

26-
# 检出依赖的xengine仓库到指定的xengine目录
2727
- name: Checkout dependency repository (xengine)
2828
uses: actions/checkout@v4
2929
with:
@@ -41,14 +41,30 @@ jobs:
4141
- name: install library
4242
run: brew install srt srtp
4343

44-
# 设置依赖库的环境变量
45-
- name: Set up Dependency Environment Variables
44+
- name: Set up Dependency x86_64 Environment
45+
if: matrix.os == 'macos-13'
4646
run: |
4747
cd libxengine
4848
chmod 777 *
4949
./XEngine_LINEnv.sh -i 3
50-
cd ..
51-
#编译
50+
- name: Set up Dependency Arm64 Environment
51+
if: matrix.os == 'macos-14'
52+
run: |
53+
cd libxengine
54+
chmod 777 *
55+
./XEngine_LINEnv.sh -i 0
56+
57+
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)
58+
59+
wget https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Mac_Arm64.zip
60+
unzip ./XEngine_Mac_Arm64.zip -d ./XEngine_Mac_Arm64
61+
cd XEngine_Mac_Arm64
62+
63+
sudo mkdir -p /usr/local/include
64+
sudo mkdir -p /usr/local/lib
65+
sudo cp -rf ./XEngine_Include /usr/local/include
66+
sudo find ./XEngine_Mac -name "*.dylib" -exec cp {} /usr/local/lib \;
67+
5268
- name: make debug
5369
run: |
5470
cd XEngine_Source
@@ -64,3 +80,17 @@ jobs:
6480
- name: test
6581
run: |
6682
cd XEngine_Release
83+
./XEngine_StreamMediaApp -t
84+
85+
- name: Upload folder as artifact with mac x64
86+
if: matrix.os == 'macos-13'
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: XEngine_StreamMediaApp-x86_64-Mac
90+
path: XEngine_Release/
91+
- name: Upload folder as artifact with mac arm
92+
if: matrix.os == 'macos-14'
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: XEngine_StreamMediaApp-Arm64-Mac
96+
path: XEngine_Release/

.github/workflows/msbuild.yml

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,29 @@ name: windows build workflows
22

33
on:
44
push:
5-
branches: [ "develop" ]
6-
pull_request:
7-
branches: [ "develop" ]
8-
9-
permissions:
10-
contents: read
5+
branches:
6+
- 'develop'
7+
paths:
8+
- 'XEngine_Source/**'
9+
- 'XEngine_Release/**'
10+
- '.github/**'
1111

1212
jobs:
1313
build:
1414
strategy:
15-
# 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.
1615
fail-fast: false
1716
matrix:
1817
configuration: [Debug ,Release]
1918
platform: [x86 ,x64]
2019

21-
runs-on: windows-latest # 最新的 Windows 环境
20+
runs-on: windows-latest
2221

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

30-
# 检出依赖的xengine仓库到指定的xengine目录
3128
- name: Checkout dependency repository (xengine)
3229
uses: actions/checkout@v4
3330
with:
@@ -63,21 +60,33 @@ jobs:
6360
./vcpkg.exe integrate install
6461
shell: pwsh
6562

66-
# 设置依赖库的环境变量
67-
- name: Set up Dependency Environment Variables
63+
- name: Set up Dependency x86_64 Environment
64+
if: matrix.platform == 'x64'
6865
run: |
6966
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
67+
echo "XENGINE_LIB64=${{ github.workspace }}/libxengine/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
7268
shell: pwsh
73-
74-
# 配置 MSBuild 的路径,准备构建 VC++ 项目
69+
- name: Set up Dependency x86_32 Environment
70+
if: matrix.platform == 'x86'
71+
run: |
72+
$response = Invoke-RestMethod -Uri "https://api.github.com/repos/libxengine/libxengine/releases/latest" -Headers @{"Accept"="application/vnd.github.v3+json"}
73+
$latest_tag = $response.tag_name
74+
Write-Host "Latest Tag: $latest_tag"
75+
76+
$url = "https://github.com/libxengine/libxengine/releases/download/$latest_tag/XEngine_Windows_x86-32.zip"
77+
Invoke-WebRequest -Uri $url -OutFile "XEngine_Windows_x86-32.zip"
78+
Expand-Archive -Path ./XEngine_Windows_x86-32.zip -DestinationPath ./XEngine_Windows -Force
79+
80+
echo "XENGINE_INCLUDE=${{ github.workspace }}/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
81+
echo "XENGINE_LIB32=${{ github.workspace }}/XEngine_Windows/XEngine_Windows" | Out-File -FilePath $env:GITHUB_ENV -Append
82+
shell: pwsh
83+
7584
- name: Setup MSBuild
7685
uses: microsoft/setup-msbuild@v2
77-
#编译
86+
7887
- name: Build Solution
7988
run: msbuild XEngine_Source/XEngine.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=${{ matrix.platform }}
80-
#测试
89+
8190
- name: Conditional Step for x86 Release
8291
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
8392
run: |
@@ -86,13 +95,28 @@ jobs:
8695
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
8796
cd XEngine_Release
8897
.\VSCopy_x86.bat
98+
./XEngine_StreamMediaApp -t
8999
shell: pwsh
90-
- name: Conditional Step for x86 Debug
91-
if: matrix.configuration == 'Debug' && matrix.platform == 'x86'
100+
- name: Conditional Step for x64 Debug
101+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
92102
run: |
93-
cp -r XEngine_Source/Debug/*.dll XEngine_Release/
94-
cp -r XEngine_Source/Debug/*.exe XEngine_Release/
95-
cp -r XEngine_Source/VSCopy_x86.bat XEngine_Release/
103+
cp -r XEngine_Source/x64/Release/*.dll XEngine_Release/
104+
cp -r XEngine_Source/x64/Release/*.exe XEngine_Release/
105+
cp -r XEngine_Source/VSCopy_x64.bat XEngine_Release/
96106
cd XEngine_Release
97-
.\VSCopy_x86.bat
98-
shell: pwsh
107+
.\VSCopy_x64.bat
108+
shell: pwsh
109+
110+
- name: Upload folder as artifact with x86
111+
if: matrix.configuration == 'Release' && matrix.platform == 'x86'
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: XEngine_StreamMediaApp-x86_32-Windows
115+
path: XEngine_Release/
116+
117+
- name: Upload folder as artifact with x64
118+
if: matrix.configuration == 'Release' && matrix.platform == 'x64'
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: XEngine_StreamMediaApp-x86_64-Windows
122+
path: XEngine_Release/

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Download ubuntubuild
19+
uses: dawidd6/action-download-artifact@v6
20+
with:
21+
workflow: ubuntubuild.yml
22+
workflow_conclusion: success
23+
check_artifacts: false
24+
skip_unpack: true
25+
if_no_artifact_found: fail
26+
path: ./XRelease/
27+
- name: Download macbuild
28+
uses: dawidd6/action-download-artifact@v6
29+
with:
30+
workflow: macbuild.yml
31+
workflow_conclusion: success
32+
check_artifacts: false
33+
skip_unpack: true
34+
if_no_artifact_found: fail
35+
path: ./XRelease/
36+
- name: Download msbuild
37+
uses: dawidd6/action-download-artifact@v6
38+
with:
39+
workflow: msbuild.yml
40+
workflow_conclusion: success
41+
check_artifacts: false
42+
skip_unpack: true
43+
if_no_artifact_found: fail
44+
path: ./XRelease/
45+
46+
- name: Display structure of downloaded files
47+
run: ls -al ./XRelease/
48+
49+
- name: Get current version and increment X
50+
id: versioning
51+
run: |
52+
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)
53+
echo "Latest tag: $latest_tag"
54+
# 提取 X 的值并递增
55+
major=$(echo $latest_tag | cut -d '.' -f 1)
56+
minor=$(echo $latest_tag | cut -d '.' -f 2)
57+
patch=$(echo $latest_tag | cut -d '.' -f 3)
58+
build=$(echo $latest_tag | cut -d '.' -f 4)
59+
60+
new_minor=$((minor + 1))
61+
new_version="$major.$new_minor.$patch.$build"
62+
echo "New version: $new_version"
63+
echo "new_tag=$new_version" >> $GITHUB_OUTPUT
64+
echo "prev_tag=$latest_tag" >> $GITHUB_OUTPUT
65+
66+
- name: Create and push new tag
67+
run: |
68+
git tag ${{ steps.versioning.outputs.new_tag }}
69+
git push origin ${{ steps.versioning.outputs.new_tag }}
70+
71+
- name: Generate release notes
72+
run: |
73+
logs=$(git log ${{ steps.versioning.outputs.prev_tag }}..${{ steps.versioning.outputs.new_tag }} --pretty=format:"* %h - %s - %an" --no-merges)
74+
release_notes=$(echo "$logs" | sed 's/ qyt$/ @xengine-qyt/')
75+
echo "$release_notes"
76+
echo "$release_notes" > release_notes.txt
77+
78+
- name: Release
79+
uses: softprops/action-gh-release@v2
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
with:
83+
draft: false
84+
prerelease: false
85+
tag_name: ${{ steps.versioning.outputs.new_tag }}
86+
name: XEngine_StreamMedia ${{ steps.versioning.outputs.new_tag }}
87+
body_path: release_notes.txt
88+
files: ./XRelease/*.zip

0 commit comments

Comments
 (0)