From 43e0860e0dbbc67afe0f8f192b48796469e175dc Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 17 Jul 2026 12:52:47 +0800 Subject: [PATCH] =?UTF-8?q?chore(CI):=20=E5=B0=87=20workflow=20=E7=A7=BB?= =?UTF-8?q?=E8=87=B3=20.gitea/workflows=20=E4=B8=A6=E6=94=B9=E7=82=BA?= =?UTF-8?q?=E5=AE=89=E8=A3=9D=E9=A9=97=E8=AD=89=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/scoped_workflows/ci.yaml | 39 --------------------------- .gitea/workflows/ci.yaml | 47 +++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 39 deletions(-) delete mode 100644 .gitea/scoped_workflows/ci.yaml create mode 100644 .gitea/workflows/ci.yaml diff --git a/.gitea/scoped_workflows/ci.yaml b/.gitea/scoped_workflows/ci.yaml deleted file mode 100644 index 3d80f6d..0000000 --- a/.gitea/scoped_workflows/ci.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: CI - -on: - pull_request: - branches: - - master - - develop - types: [opened, synchronize] - -env: - REPOSITORY_NAME: ${{ gitea.event.repository.name }} - IS_BETA: ${{ gitea.base_ref == 'develop' }} - -jobs: - build: - name: BUILD - runs-on: ubuntu - steps: - - name: 取得存取庫資訊 (含 Tag) - uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} - with: - fetch-depth: 0 - - name: 計算下一個版本號 - uses: https://gitea.jsc.idv.tw/docker-actions/calculate-next-version@${{ vars.ACTION_CALCULATE_NEXT_VERSION }} - id: calculate-next-version - with: - is_beta: ${{ env.IS_BETA }} - - name: 發布成品 - uses: akkuman/gitea-release-action@${{ vars.ACTION_GITEA_RELEASE_VERSION }} - env: - VERSION: ${{ steps.calculate-next-version.outputs.value }} - with: - name: "${{ gitea.event.repository.name }} v${{ env.VERSION }}" - tag_name: "v${{ env.VERSION }}" - target_commitish: "${{ gitea.sha }}" - prerelease: ${{ env.IS_BETA }} - - name: 清理舊成品 - uses: https://gitea.jsc.idv.tw/docker-actions/clean-old-release@${{ vars.ACTION_CLEAN_OLD_RELEASE }} - if: ${{ env.IS_BETA == 'false' }} diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..ea8f090 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,47 @@ +# ============================================================================ +# 用途:本 CI workflow 於對 master 或 develop 發出 Pull Request(開啟或更新)時觸發, +# checkout 原始碼後以本 repo 的 composite action 安裝工具,並取得工具版本號驗證安裝。 +# 更新時間:2026/07/17 12:38:20 +# ============================================================================ +# workflow 名稱,顯示於 Gitea Actions 介面 +name: CI + +# 觸發條件設定區塊 +on: + # 針對 Pull Request 事件觸發 + pull_request: + # 僅當 PR 目標分支為下列分支時觸發 + branches: + - master + - develop + # 僅在 PR 開啟(opened)或有新 commit 更新(synchronize)時觸發 + types: [opened, synchronize] + +# 全域環境變數,供各 job/step 引用 +env: + # 是否為 beta:當 PR 目標分支為 develop 時為 true + IS_BETA: ${{ gitea.base_ref == 'develop' }} + +# 工作(job)定義區塊 +jobs: + # test job:驗證本 composite action 能正確安裝工具 + test: + # job 顯示名稱 + name: TEST + # 執行環境(runner 標籤) + runs-on: ubuntu + # 依序執行的步驟清單 + steps: + # 取出原始碼,供後續以本地 action(./)安裝工具 + - name: 取得存取庫資訊 + # 使用 checkout action,版本由 vars.ACTION_CHECKOUT_VERSION 決定 + uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} + # 引用本 repo 根目錄的 composite action 安裝工具 + # 需人工確認:本 action 的 oauth 為必填輸入,此處未傳入;實際執行需以 with: oauth: ${{ secrets.CODEX_OAUTH_B64 }} 傳入 + - name: 安裝工具 + # uses: ./ 代表使用本 repo 內的 action.yml + uses: ./ + # 取得工具版本號以驗證安裝成功 + - name: 取得工具版本號 + # 執行 Codex CLI 的版本查詢指令 + run: codex --version