feat: 重構

This commit is contained in:
2026-03-21 20:59:12 +08:00
parent bcbda5eab4
commit 30e62fdc58
4 changed files with 118 additions and 21 deletions

View File

@@ -3,26 +3,25 @@ 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個)
tag_name: "v${{ needs.version.outputs.version }}"
- name: 清理成品
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 }}
RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }}