@echo off REM Upload wheel to Forgejo PyPI for Agravity Client REM REM Prerequisites: REM 1. Create .pypirc file in project root REM 2. Copy from .pypirc.example and add your credentials REM REM Usage: REM upload_wheel_to_forgejo_pypi.bat [--build] REM Options: --build Force rebuild before upload setlocal enabledelayedexpansion set PYPIRC_SRC=%CD%\.pypirc set PYPIRC_DEST=%USERPROFILE%\.pypirc echo. echo ======================================================================== echo Agravity Client - Upload to Forgejo PyPI echo ======================================================================== echo. REM Check for .pypirc if not exist ".pypirc" ( echo [!] .pypirc not found in project root! echo. echo Setup instructions: echo 1. cp .pypirc.example .pypirc echo 2. Edit .pypirc with your Forgejo credentials echo 3. Run this script again echo. pause exit /b 1 ) REM Copy .pypirc to user profile echo Configuring credentials... copy /Y "%PYPIRC_SRC%" "%PYPIRC_DEST%" > nul REM Activate virtual environment (if exists) if exist .venv\Scripts\activate.bat ( call .venv\Scripts\activate.bat ) REM Install twine if needed python -m pip list | find /I "twine" > nul if errorlevel 1 ( echo Installing twine... python -m pip install -q twine ) cd /d "%~dp0" REM Check for --build flag if "%~1"=="--build" ( echo Building wheel (forced)... rmdir /s /q dist > nul 2>&1 python build_wheel.py if errorlevel 1 ( del "%PYPIRC_DEST%" if exist .venv\Scripts\deactivate.bat call .venv\Scripts\deactivate.bat exit /b 1 ) ) else ( REM Build wheel if not present if not exist dist\*.whl ( echo Building wheel... python build_wheel.py if errorlevel 1 ( del "%PYPIRC_DEST%" if exist .venv\Scripts\deactivate.bat call .venv\Scripts\deactivate.bat exit /b 1 ) ) ) REM Upload to Forgejo PyPI echo. echo ======================================================================== echo Uploading to Forgejo PyPI... echo ======================================================================== echo. twine upload -r forgejo dist\*.whl set UPLOAD_RESULT=%errorlevel% REM Cleanup del "%PYPIRC_DEST%" if exist .venv\Scripts\deactivate.bat call .venv\Scripts\deactivate.bat echo. echo ======================================================================== if %UPLOAD_RESULT% equ 0 ( echo Upload successful! ) else ( echo Upload failed ) echo ======================================================================== echo. endlocal pause exit /b %UPLOAD_RESULT%