From 4e3baa22944945fdca97a772eef5cc3ff7bf814d Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 26 Jun 2026 15:22:23 +0000 Subject: [PATCH 1/2] =?UTF-8?q?feat(release-tag-version):=20=E8=BC=B8?= =?UTF-8?q?=E5=87=BA=E9=87=8B=E5=87=BA=E7=89=88=E6=9C=AC=E8=99=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/action.yml b/action.yml index a1479fc..3dc6f67 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,11 @@ inputs: required: false default: 'false' +outputs: + version: + description: '本次釋出的版本號' + value: ${{ steps.calculate-version.outputs.version }} + runs: using: 'composite' steps: From 26f8bfcec4256a061ede91d2cd3a0c37ca9820b5 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 26 Jun 2026 15:22:30 +0000 Subject: [PATCH 2/2] =?UTF-8?q?docs(README):=20=E8=A3=9C=E5=85=85=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=99=9F=E8=BC=B8=E5=87=BA=E7=94=A8=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 763c2e1..9d4f1a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Release Tag Version -更新時間:2026/06/26 10:56:00 +更新時間:2026/06/26 11:20:00 本專案為 Gitea Actions 的 **composite action**,用來自動計算版本號、建立 release 並標註對應 tag,最後清理舊成品。 @@ -39,12 +39,15 @@ steps: - name: 取得程式碼 uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} - name: 釋出並標註成品版本 + id: release uses: https://gitea.jsc.idv.tw/composite-actions/release-tag-version@ with: # files 為非必填;指定要隨 release 一起釋出(上傳)的成品檔案,可省略。 files: dist/* # is_debug 為非必填;設為 true 時,會轉傳給 calculate-version 產生測試標籤版本。 is_debug: 'false' +- name: 使用釋出版本號 + run: echo "version=${{ steps.release.outputs.version }}" ``` ### 本 repo 內的 CD workflow(`.gitea/workflows/cd.yaml`) @@ -70,7 +73,7 @@ jobs: 引用後,composite action 會依序執行: -1. **版本號計算**:呼叫 `docker-actions/calculate-version` 算出本次版本號,並轉傳 `is_debug` 以支援測試標籤版本。 +1. **版本號計算**:呼叫 `docker-actions/calculate-version` 算出本次版本號,轉傳 `is_debug` 以支援測試標籤版本,並輸出 `outputs.version`。 2. **組合釋出參數**:版本號非空時,組出 release 的 `name`(格式 ` v<版本>`)與 `tag_name`(格式 `v<版本>`)。 3. **檢查版本號輸出**:版本號為空時輸出錯誤訊息並 `exit 1`,中止流程,避免建立錯誤的 release/tag。 4. **釋出並標註成品版本**:以 `akkuman/gitea-release-action` 建立 release 並打 tag,附帶 `files` 指定的成品。