feat: 重構清理舊版成品

This commit is contained in:
2026-03-21 10:32:21 +08:00
parent cd5480b334
commit e3f3743950
7 changed files with 108 additions and 446 deletions

View File

@@ -3,26 +3,28 @@ on:
branches:
- master
jobs:
cd:
name: "CD > 發布專案"
runs-on: docker
env:
RUNNER_TOOL_CACHE: /toolcache
version:
name: "CD > 計算版本號"
runs-on: ubuntu
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: 計算版本號
id: version
uses: https://gitea.jsc.idv.tw/actions/calculate-version@${{ vars.ACTION_CALCULATE_VERSION }}
with:
gitea-server: ${{ gitea.server_url }}
repository: ${{ gitea.repository }}
token: ${{ secrets.GITEA_TOKEN }}
release:
name: "CD > 發布專案"
runs-on: ubuntu
needs: version
steps:
- name: 發布專案
uses: akkuman/gitea-release-action@${{ vars.ACTION_RELEASE_VERSION }}
with:
tag_name: "v${{ steps.version.outputs.VERSION }}"
- name: 清理舊版本 (保留最新2個)
uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }}
with:
gitea-server: ${{ gitea.server_url }}
repository: ${{ gitea.repository }}
token: ${{ secrets.GITEA_TOKEN }}
tag_name: "v${{ needs.version.outputs.version }}"
test:
name: "CD > 清理舊版成品"
runs-on: ubuntu
needs: release
steps:
- name: 清理舊版成品
uses: https://gitea.jsc.idv.tw/actions/cleanup-release@${{ vars.ACTION_CLEANUP_RELEASE_VERSION }}