chore(CI): 將 workflow 移至 .gitea/workflows 並改為安裝驗證流程
composite-actions/template: CI / BUILD (pull_request) Failing after 4s
CI / TEST (pull_request) Successful in 20s

This commit is contained in:
Jeffery
2026-07-17 12:52:47 +08:00
parent ba09deed85
commit 43e0860e0d
2 changed files with 47 additions and 39 deletions
-39
View File
@@ -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' }}
+47
View File
@@ -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