Skip to content

Commit 176e14d

Browse files
kaizhou-labzk
andauthored
ci: create source-only draft release upstream while keeping builds gated (#3899)
With PUBLISH_RELEASE unset (upstream AionUi), stable tag pushes now still create a draft GitHub Release (auto release notes, no installer assets) after code quality passes, while build-pipeline and pack-web-cli stay skipped. With PUBLISH_RELEASE=true (downstream signed build) behavior is unchanged: builds must succeed and installers are attached. Artifact download/prepare steps are gated so the assetless path cannot fail. Co-authored-by: zk <zk@users.noreply.local>
1 parent 413a7af commit 176e14d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/build-and-release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,14 @@ jobs:
251251
GH_TOKEN: ${{ secrets.GH_TOKEN }}
252252

253253
# 发布到 GitHub Releases
254+
# PUBLISH_RELEASE 未设置(上游 AionUi):跳过构建,但正式 tag 仍创建纯源码 draft Release;
255+
# PUBLISH_RELEASE=true(下游签名构建):与之前一致,要求构建成功并附带安装包。
254256
release:
255257
name: Create Release
256258
runs-on: ubuntu-latest
257-
needs: [build-pipeline, create-tag, pack-web-cli]
259+
needs: [code-quality, build-pipeline, create-tag, pack-web-cli]
258260
# Tag 推送时 create-tag 会被跳过,所以需要检查两种情况(排除 -dev- tag 避免重复)
259-
if: always() && vars.PUBLISH_RELEASE == 'true' && needs.build-pipeline.result == 'success' && needs.pack-web-cli.result == 'success' && (needs.create-tag.result == 'success' || (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-dev-')))
261+
if: always() && needs.code-quality.result == 'success' && (needs.create-tag.result == 'success' || (startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-dev-'))) && (vars.PUBLISH_RELEASE != 'true' || (needs.build-pipeline.result == 'success' && needs.pack-web-cli.result == 'success'))
260262
# dev 分支使用 dev-release 环境,正式 tag 使用 release 环境
261263
environment: ${{ needs.create-tag.outputs.is_dev == 'true' && 'dev-release' || 'release' }}
262264

@@ -283,12 +285,15 @@ jobs:
283285
echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT
284286
echo "is_dev=$IS_DEV" >> $GITHUB_OUTPUT
285287
288+
# 仅下游签名构建有安装包产物;上游 AionUi 发布纯源码 Release,无产物可下载
286289
- name: Download all build artifacts
290+
if: vars.PUBLISH_RELEASE == 'true'
287291
uses: actions/download-artifact@v7
288292
with:
289293
path: build-artifacts
290294

291295
- name: Prepare release assets (normalize updater metadata)
296+
if: vars.PUBLISH_RELEASE == 'true'
292297
shell: bash
293298
run: bash scripts/prepare-release-assets.sh build-artifacts release-assets
294299

0 commit comments

Comments
 (0)