From b8a4b73bb06d1f3d35d04037efcf5afa4e9d0e6a Mon Sep 17 00:00:00 2001 From: EUForest Date: Mon, 24 Nov 2025 18:21:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E7=AD=BE=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E8=87=AA=E5=8A=A8=E5=88=9B=E5=BB=BA=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 tags 触发器支持 v* 格式的标签 - 标签推送时自动创建 GitHub Release - 自动上传二进制文件到 Release --- .github/workflows/deploy-linux.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-linux.yml b/.github/workflows/deploy-linux.yml index 2b51115..2029458 100644 --- a/.github/workflows/deploy-linux.yml +++ b/.github/workflows/deploy-linux.yml @@ -3,6 +3,9 @@ name: Build Linux Binary on: push: branches: [ main, master ] + push: + tags: + - 'v*' workflow_dispatch: inputs: version: @@ -89,16 +92,23 @@ jobs: retention-days: 30 - name: Create and Upload to GitHub Release - if: github.event_name == 'release' || github.event.inputs.create_release == 'true' + if: github.event_name == 'release' || github.event.inputs.create_release == 'true' || startsWith(github.ref, 'refs/tags/') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | + # Create release if it doesn't exist if [ "${{ github.event.inputs.create_release }}" = "true" ] && [ "${{ github.event_name }}" = "workflow_dispatch" ]; then echo "Creating release for ${{ env.VERSION }}" gh release create ${{ env.VERSION }} \ --title "PPanel Server ${{ env.VERSION }}" \ --notes "Release ${{ env.VERSION }}" \ --latest + elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref_type }}" = "tag" ]; then + echo "Creating release for tag ${{ env.VERSION }}" + gh release create ${{ env.VERSION }} \ + --title "PPanel Server ${{ env.VERSION }}" \ + --notes "Release ${{ env.VERSION }}" \ + --latest fi echo "Uploading binaries to release ${{ env.VERSION }}"