File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9191
9292非 master 分支的推送**不会触发** workflow,避免资源浪费。只有创建 PR 时才会触发精简构建。
9393
94+ ### 4. workflow 分支(全量构建)
95+
96+ 当分支名包含 ` workflow` 时,会触发**全量构建**(等同于 master 全量矩阵),用于验证完整矩阵是否可通过。
97+
9498# # 产物命名规则
9599
96100构建产物 (APK) 使用以下命名格式:
@@ -108,6 +112,10 @@ apk-{OS}-{NDK}-{BuildSystem}-{FFmpeg}-{PageSize}.apk
108112
109113代码质量检查在 PR 和 master 分支推送时运行,确保主干代码质量。
110114
115+ # # Release 工作流(测试分支)
116+
117+ 当分支名包含 `workflow` 且触发 `release.yml` 时,将从 `build.gradle` 读取 `versionName`,生成 `v{版本号}-test` 的测试标签,**仅构建并上传 APK 工件**,不会创建 Release 或发布任何内容。
118+
111119# # 本地测试
112120
113121可以使用项目根目录的 `tasks.sh` 脚本在本地进行构建测试:
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ name: macOS Build
22
33on :
44 push :
5- branches : [ "master" ]
5+ branches :
6+ - " master"
7+ - " *workflow*"
68 pull_request :
79 branches : [ "master" ]
810
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ name: Release APKs
22
33on :
44 push :
5+ branches :
6+ - " *workflow*"
57 tags :
68 - ' v*.*.*'
79 - ' v*.*.*-beta*'
5254 run : |
5355 if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
5456 echo "RELEASE_TAG=${{ inputs.version }}" >> $GITHUB_ENV
57+ echo "SHOULD_RELEASE=${{ inputs.create_release }}" >> $GITHUB_ENV
58+ elif [ "${{ github.ref_type }}" = "branch" ]; then
59+ VERSION=$(grep -E 'versionName' build.gradle | head -n 1 | sed -E 's/.*versionName[^\"]*\"([^\"]+)\".*/\1/')
60+ if [ -z "$VERSION" ]; then
61+ echo "Error: Failed to parse versionName from build.gradle"
62+ exit 1
63+ fi
64+ echo "RELEASE_TAG=v${VERSION}-test" >> $GITHUB_ENV
65+ echo "SHOULD_RELEASE=false" >> $GITHUB_ENV
5566 else
5667 echo "RELEASE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
68+ echo "SHOULD_RELEASE=true" >> $GITHUB_ENV
5769 fi
5870 echo "APK_NAME=cgeDemo-${{ matrix.artifact_name }}.apk" >> $GITHUB_ENV
5971
@@ -101,7 +113,7 @@ jobs:
101113 if-no-files-found : error
102114
103115 - name : Upload to GitHub Release
104- if : github.event_name == 'push' || inputs.create_release
116+ if : env.SHOULD_RELEASE == 'true'
105117 uses : softprops/action-gh-release@v2
106118 with :
107119 tag_name : ${{ env.RELEASE_TAG }}
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ name: Ubuntu Build
22
33on :
44 push :
5- branches : [ "master" ]
5+ branches :
6+ - " master"
7+ - " *workflow*"
68 pull_request :
79 branches : [ "master" ]
810
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ name: Windows Build
22
33on :
44 push :
5- branches : [ "master" ]
5+ branches :
6+ - " master"
7+ - " *workflow*"
68 pull_request :
79 branches : [ "master" ]
810
You can’t perform that action at this time.
0 commit comments