From 2a69cdc84b0e0b352b344455055513a3ba8a59c4 Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Wed, 6 Nov 2024 00:02:58 +0800 Subject: [PATCH] fix tags. --- .gitea/workflows/build_windows.yaml | 17 +++++++++++++++-- .gitea/workflows/release_windows.yaml | 9 ++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build_windows.yaml b/.gitea/workflows/build_windows.yaml index 8c14db0..ccb2c76 100644 --- a/.gitea/workflows/build_windows.yaml +++ b/.gitea/workflows/build_windows.yaml @@ -7,11 +7,24 @@ jobs: steps: - name: Clone repository run: | - $branch = "${{ github.ref }}" -replace '^refs/heads/', '' + $ref = "${{ github.ref }}" + if ($ref -like 'refs/heads/*') { + $branch = $ref -replace '^refs/heads/', '' + } elseif ($ref -like 'refs/tags/*') { + $branch = $ref -replace '^refs/tags/', '' + } else { + $branch = $ref + } git clone --depth 1 --branch=$branch https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_PASSWORD }}@amass.fun/gitea/${{ gitea.repository }}.git . git checkout ${{ github.sha }} - name: Build and deploy run: | resources/build.ps1 build resources/build.ps1 deploy - resources/build.ps1 changelog \ No newline at end of file + resources/build.ps1 changelog + - name: Upload Gitea Release + uses: akkuman/gitea-release-action@v1 + with: + body_path: build/CHANGELOG.txt + files: |- + build/SmartLockerTools_v*.zip \ No newline at end of file diff --git a/.gitea/workflows/release_windows.yaml b/.gitea/workflows/release_windows.yaml index 85f3c98..f70876b 100644 --- a/.gitea/workflows/release_windows.yaml +++ b/.gitea/workflows/release_windows.yaml @@ -10,7 +10,14 @@ jobs: steps: - name: Clone repository run: | - $branch = "${{ github.ref }}" -replace '^refs/tags/', '' + $ref = "${{ github.ref }}" + if ($ref -like 'refs/heads/*') { + $branch = $ref -replace '^refs/heads/', '' + } elseif ($ref -like 'refs/tags/*') { + $branch = $ref -replace '^refs/tags/', '' + } else { + $branch = $ref + } git clone --depth 1 --branch=$branch https://${{ secrets.GIT_USERNAME }}:${{ secrets.GIT_PASSWORD }}@amass.fun/gitea/${{ gitea.repository }}.git . git checkout ${{ github.sha }} - name: Build and deploy