diff --git a/.gitea/workflows/master.yaml b/.gitea/workflows/master.yaml index 879ac69..b54c903 100644 --- a/.gitea/workflows/master.yaml +++ b/.gitea/workflows/master.yaml @@ -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 }} \ No newline at end of file + RUNNER_TOKEN: ${{ secrets.RUNNER_TOKEN }} \ No newline at end of file diff --git a/action.yaml b/action.yaml index ca579ad..a2cf5f0 100644 --- a/action.yaml +++ b/action.yaml @@ -3,11 +3,11 @@ description: '推送 NUGET 套件' author: 'Jeffery' inputs: RELEASE_VERSION: - required: true description: '要推送的版本號,ex: ${{ needs.calculate.outputs.version }}' + required: true RELEASE_INDEX: - default: 0 description: '要推送的版本中第幾個成品,預設為 0' + default: 0 runs: using: 'docker' image: 'Dockerfile'