@echo off
if "%1"=="" (
  echo Usage: release.bat 1.0.1
  exit /b 1
)

set VERSION=%1

echo.
echo Releasing version %VERSION%...
echo.

:: Update version.json
echo { "version": "%VERSION%" } > version.json

git add .
git commit -m "Release v%VERSION%"
git tag v%VERSION%
git push origin main
git push origin v%VERSION%

echo.
echo Done! Now publish the release on GitHub:
echo https://github.com/kaushalarwal/Nettbyte-Kpanel/releases/new?tag=v%VERSION%
echo.
pause
