From b63f45706228473fd66e15ffd8eb19159993a600 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Thu, 25 Jun 2026 09:14:41 +0000 Subject: [PATCH] Refactor tag release action and update workflow to use local action --- .gitea /workflows/cd.yaml | 9 +++----- action.yml | 47 +++++++++++++++----------------------- 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/ .gitea /workflows/cd.yaml b/ .gitea /workflows/cd.yaml index 7b9122c..6662007 100644 --- a/ .gitea /workflows/cd.yaml +++ b/ .gitea /workflows/cd.yaml @@ -8,10 +8,7 @@ jobs: name: Release Tag runs-on: ubuntu steps: + - name: Checkout + uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }} - name: Release Tag - uses: https://gitea.jsc.idv.tw/composite-actions/release-tag@${{ vars.ACTION_VERSION_CALCULATE_VERSION }} - with: - gitea_token: ${{ secrets.GITEA_TOKEN }} - gitea_release: ${{ vars.ACTION_GITEA_RELEASE_VERSION }} - version_calculate: ${{ vars.ACTION_VERSION_CALCULATE_VERSION }} - release_cleanup: ${{ vars.ACTION_RELEASE_CLEANUP_VERSION }} + uses: ./ diff --git a/action.yml b/action.yml index 321241a..b008db9 100644 --- a/action.yml +++ b/action.yml @@ -1,36 +1,25 @@ -name: 'Composite Action Template' -description: 'Composite Action 範本' +name: 'Tag Release' +description: 'Tag Release' author: 'Jeffery' inputs: - gitea_token: - description: 'Gitea Token' - required: true - text: - description: '輸入的文字' + files: + description: '' required: false - default: 'Hello, World!' -outputs: - text: - description: '輸出的文字' - value: ${{ steps.change.outputs.text }} runs: using: 'composite' steps: - - name: 交換 - id: change + - name: 版本號計算 + id: version-calculate + uses: https://gitea.jsc.idv.tw/docker-actions/version-calculate@${{ vars.ACTION_VERSION_CALCULATE_VERSION }} + - name: 標註並釋出成品 + uses: akkuman/gitea-release-action@${{ vars.ACTION_GITEA_RELEASE_VERSION }} env: - GITEA_SERVER_URL: ${{ gitea.server_url }} - GITEA_REPOSITORY: ${{ gitea.repository }} - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN || inputs.gitea_token }} - TEXT: ${{ inputs.text }} - run: | - echo "Gitea Server Url: $GITEA_SERVER_URL" - - echo "Gitea Repository: $GITEA_REPOSITORY" - - echo "Gitea Token: $GITEA_TOKEN" - - echo "Text: $TEXT" - - echo "text=$TEXT" >> "$GITHUB_OUTPUT" - shell: bash \ No newline at end of file + NAME: ${{ gitea.repository##*/ }} + VERSION: v${{ steps.version-calculate.outputs.version }} + with: + name: $NAME $VERSION + tag_name: $VERSION + target_commitish: ${{ gitea.ref }} + files: ${{ inputs.files }} + - name: 清理舊成品 + uses: https://gitea.jsc.idv.tw/docker-actions/release-cleanup@${{ vars.ACTION_RELEASE_CLEANUP_VERSION }} \ No newline at end of file -- 2.53.0