Jelajahi Sumber

【维护】重构 ISO 构建流程并添加测试工作流

- 修改 build_iso.yaml:
  - 移除上传 ISO 的步骤
  - 添加 rebrand 步骤以支持自定义 UI 和登录页面
- 新增 test.yaml:
  - 创建新的测试工作流,包含 ISO 构建和上传步骤
  - 增加工作流调度和手动触发支持
PJ568 1 tahun lalu
induk
melakukan
9b2c2c2d97
2 mengubah file dengan 53 tambahan dan 13 penghapusan
  1. 12 13
      .github/workflows/build_iso.yaml
  2. 41 0
      .github/workflows/test.yaml

+ 12 - 13
.github/workflows/build_iso.yaml

@@ -6,11 +6,15 @@ on:
       name:
         description: "OS name"
         required: false
-        default: "pageos"
-
-concurrency:
-  group: "测试"
-  cancel-in-progress: true
+        default: ""
+      custom-ui-id:
+        description: "The ID of the UI package to use"
+        required: false
+        default: ""
+      custom-login-html-url:
+        description: "OS name"
+        required: false
+        default: ""
 
 jobs:
   build-iso:
@@ -28,13 +32,8 @@ jobs:
       - name: Setup actions environment
         run: ./scripts/gh_acions_setup.bash
 
+      - name: Rebrand
+        run: ./scripts/rebrand.bash "${{ github.event.inputs.custom-ui-id }}" "${{ github.event.inputs.custom-login-html-url }}" "${{ github.event.inputs.name }}"
+
       - name: Run build script
         run: sudo -u builder ./build.bash --noconfirm
-
-      - name: Upload ISO artifact
-        uses: actions/upload-artifact@v4
-        with:
-          name: ${{ github.event.inputs.name || 'pageos' }}
-          path: target/*.iso
-          compression-level: 9 # maximum compression
-          retention-days: 5

+ 41 - 0
.github/workflows/test.yaml

@@ -0,0 +1,41 @@
+name: Test
+
+on:
+  push:
+  workflow_dispatch:
+    inputs:
+      name:
+        description: "OS name"
+        required: false
+        default: ""
+      custom-ui-id:
+        description: "The ID of the UI package to use"
+        required: false
+        default: ""
+      custom-login-html-url:
+        description: "OS name"
+        required: false
+        default: ""
+
+concurrency:
+  group: "Test"
+  cancel-in-progress: true
+
+jobs:
+  build-iso:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Build PageOS ISO
+        uses: ./.github/workflows/build_iso.yaml
+        with:
+          name: "${{ github.event.inputs.name }}"
+          custom-ui-id: "${{ github.event.inputs.custom-ui-id }}"
+          custom-login-html-url: "${{ github.event.inputs.custom-login-html-url }}"
+
+      - name: Upload ISO artifact
+        uses: actions/upload-artifact@v4
+        with:
+          name: ${{ github.event.inputs.name || 'pageos' }}
+          path: target/*.iso
+          compression-level: 9 # maximum compression
+          retention-days: 5