diff --git a/.github/workflows/deploy-linux.yml b/.github/workflows/deploy-linux.yml index 5fc3bb7..1996507 100644 --- a/.github/workflows/deploy-linux.yml +++ b/.github/workflows/deploy-linux.yml @@ -62,5 +62,18 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | VERSION=${GITHUB_REF#refs/tags/} - gh release create $VERSION --title "PPanel Server $VERSION" || true - gh release upload $VERSION ppanel-server-${VERSION}-linux-amd64.tar.gz checksum.txt + + # Check if release exists + if gh release view $VERSION >/dev/null 2>&1; then + echo "Release $VERSION already exists, deleting old assets..." + # Delete existing assets if they exist + gh release delete-asset $VERSION ppanel-server-${VERSION}-linux-amd64.tar.gz --yes 2>/dev/null || true + gh release delete-asset $VERSION checksum.txt --yes 2>/dev/null || true + else + echo "Creating new release $VERSION..." + gh release create $VERSION --title "PPanel Server $VERSION" --notes "Release $VERSION" + fi + + # Upload assets (will overwrite if --clobber is supported, otherwise will fail gracefully) + echo "Uploading assets..." + gh release upload $VERSION ppanel-server-${VERSION}-linux-amd64.tar.gz checksum.txt --clobber