From ea5f9e23990920fc840e7b3d170bbc745b4a5a5c Mon Sep 17 00:00:00 2001 From: Jeffery Date: Sat, 21 Mar 2026 10:53:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B8=85=E7=90=86=E6=88=90=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/master.yaml | 13 ++++++++++--- entrypoint.sh | 5 ++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/master.yaml b/.gitea/workflows/master.yaml index 475eba2..acc170b 100644 --- a/.gitea/workflows/master.yaml +++ b/.gitea/workflows/master.yaml @@ -4,12 +4,12 @@ on: - master jobs: version: - name: "CD > 計算版本號" + name: "CD > 計算版本" runs-on: ubuntu outputs: version: ${{ steps.version.outputs.version }} steps: - - name: 計算版本號 + - name: 計算版本 id: version uses: https://gitea.jsc.idv.tw/actions/calculate-version@${{ vars.ACTION_CALCULATE_VERSION }} release: @@ -20,4 +20,11 @@ jobs: - name: 發布專案 uses: akkuman/gitea-release-action@${{ vars.ACTION_RELEASE_VERSION }} with: - tag_name: "v${{ needs.version.outputs.version }}" \ No newline at end of file + tag_name: "v${{ needs.version.outputs.version }}" + cleanup: + name: "CD > 清理成品" + runs-on: ubuntu + needs: release + steps: + - name: 清理成品 + uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }} \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index eb7eab4..b799aff 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -24,6 +24,7 @@ echo "--------------------------------------------------" # 組合 RELEASE_URL 參數,並顯示出來 RELEASE_URL="$GITEA_SERVER_URL/api/v1/repos/$GITEA_REPOSITORY/releases" && echo "RELEASE_URL=$RELEASE_URL" +# 檢查是否為空或 "null" if [ -n "$RUNNER_TOKEN" ] && [ "$RUNNER_TOKEN" != "null" ]; then # 組合 RELEASE_HEADER 參數,並顯示出來 RELEASE_HEADER="Authorization: token $RUNNER_TOKEN" && echo "RELEASE_HEADER=$RELEASE_HEADER" @@ -71,4 +72,6 @@ PATCH=$((PATCH + 1)) NEW_VERSION="$MAJOR.$MINOR.$PATCH" && echo "NEW_VERSION=$NEW_VERSION" # 將版本輸出到環境變數 -echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT \ No newline at end of file +echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT + +echo "==================================================" \ No newline at end of file -- 2.48.1