ci: 发布验收 P0 项——补齐 CI/CD 工作流
- .github/workflows/ci.yml: push/PR 触发,复用 halo-sigs/reusable-workflows plugin-ci.yaml@v5 执行 ./gradlew clean build(全部测试+检查) - .github/workflows/cd.yml: GitHub Release published 触发,复用 plugin-cd.yaml@v5, 按发布 tag 去 v 前缀注入 -Pversion 构建(-x check,不替代发布前 CI), skip-appstore-release: true——首次上架审核前只上传 Release 资产,不自动同步应用市场 - 根目录 gradlew/gradlew.bat: 转发到 plugin-operation-audit/ 的 Gradle wrapper (官方可复用工作流从仓库根执行 ./gradlew,build-args 以 -p 指定子项目目录) - artifacts-path 限定 plugin-operation-audit/build/libs(仅插件 JAR,不误传其他制品)
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
name: CD
|
||||||
|
|
||||||
|
# Halo 官方可复用插件 CD 工作流:基于 GitHub Release tag 注入版本号构建 JAR 并
|
||||||
|
# 上传到 Release 资产。可复用工作流内部执行:
|
||||||
|
# ./gradlew clean build -x check -Pversion=${tag 去 v 前缀} <build-args>
|
||||||
|
# 因此 Release tag(如 v0.1.0)自动保证 JAR 文件名 / plugin.yaml spec.version /
|
||||||
|
# Manifest Implementation-Version 三处一致。
|
||||||
|
# 注意:CD 构建带 -x check,不能替代发布前必须通过且不可跳过的 CI 与测试。
|
||||||
|
# 首次上架应用市场审核通过前,skip-appstore-release: true —— 只上传
|
||||||
|
# GitHub Release 资产,不自动同步应用市场;审核通过后按官方发布文档
|
||||||
|
# 配置 app-id 与最小权限的个人令牌(HALO_PAT)后再开启同步。
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
cd:
|
||||||
|
uses: halo-sigs/reusable-workflows/.github/workflows/plugin-cd.yaml@v5
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
with:
|
||||||
|
ui-path: "plugin-operation-audit/ui"
|
||||||
|
artifacts-path: "plugin-operation-audit/build/libs"
|
||||||
|
build-args: "-p plugin-operation-audit"
|
||||||
|
skip-node-setup: true
|
||||||
|
skip-appstore-release: true
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
# Halo 官方可复用插件 CI 工作流:./gradlew clean build(含全部后端测试与 UI 检查)。
|
||||||
|
# 本仓库 Gradle 构建根在 plugin-operation-audit/ 子目录:
|
||||||
|
# - 根目录 gradlew/gradlew.bat 是转发脚本;
|
||||||
|
# - build-args 传 -p 指定项目目录。
|
||||||
|
# UI 子项目使用 npm(package-lock.json),没有 pnpm-lock.yaml,
|
||||||
|
# 因此 skip-node-setup: true,由 ubuntu-latest 预装的 Node/npm 配合
|
||||||
|
# node-gradle 插件(download = false)完成前端构建与 vitest 测试。
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
uses: halo-sigs/reusable-workflows/.github/workflows/plugin-ci.yaml@v5
|
||||||
|
with:
|
||||||
|
ui-path: "plugin-operation-audit/ui"
|
||||||
|
artifacts-path: "plugin-operation-audit/build/libs"
|
||||||
|
build-args: "-p plugin-operation-audit"
|
||||||
|
skip-node-setup: true
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 仓库根目录不是 Gradle 构建根:插件项目位于 plugin-operation-audit/ 子目录。
|
||||||
|
# Halo 官方可复用插件 CI/CD 工作流(halo-sigs/reusable-workflows)从仓库根执行
|
||||||
|
# ./gradlew clean build,此脚本将调用转发到子项目的 Gradle wrapper。
|
||||||
|
# 本地等价命令:./gradlew clean build -p plugin-operation-audit
|
||||||
|
exec "$(dirname "$0")/plugin-operation-audit/gradlew" "$@"
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
@echo off
|
||||||
|
rem 仓库根目录不是 Gradle 构建根:插件项目位于 plugin-operation-audit\ 子目录。
|
||||||
|
rem Halo 官方可复用插件 CI/CD 工作流(halo-sigs/reusable-workflows)从仓库根执行
|
||||||
|
rem ./gradlew clean build,此脚本将调用转发到子项目的 Gradle wrapper。
|
||||||
|
rem 本地等价命令:gradlew.bat clean build -p plugin-operation-audit
|
||||||
|
"%~dp0plugin-operation-audit\gradlew.bat" %*
|
||||||
Reference in New Issue
Block a user