import urllib.request import json import os import subprocess import shutil token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075" owner_repo = "sanjeok77/ShiftRing" tag = "v1.0.5" title = "v1.0.5 - 메모 아이콘 정리, 삼성 One UI 8.5/9.0 알람 화면 리디자인, 달력 초기 깜빡임 해소 및 카드 스택 레이어 전환 애니메이션 적용" body = """## 🚀 ShiftRing v1.0.5 릴리즈 ### 🌟 주요 변경 및 개선 사항 1. **하루 메모 불필요한 하단 아이콘 제거 (`item_day.xml`, `CalendarAdapter.kt`)**: - 메모 텍스트가 이미 상단/중앙에 4줄로 표시되므로 중복되던 하단 메모/수정 아이콘을 깔끔하게 제거하여 셀 공간 최적화 2. **알람 울림/해제 화면 삼성 One UI 8.5/9.0 최신 디자인 전면 개편 (`activity_alarm.xml`, `AlarmActivity.kt`)**: - 상단 근무 라벨 뱃지 + 대형 현대적 시계 타이포그래피 + 날짜 정보 일원화 - 중앙 와이드 글래스 캡슐 허브 다시 울림(스누즈) 버튼 탑재 - 하단 듀얼 펄스 웨이브 앰비언트 글로우 및 옴니 다이렉션 스와이프/탭 해제 컨트롤 적용 3. **앱 초기 실행 시 달력 화면 깜빡임(Flicker) 완벽 해소 (`MainActivity.kt`)**: - `RecyclerView` 불필요한 기본 애니메이터 제거 및 어댑터/행 높이 재계산 로직 최적화로 초기 진입 시 잔상 없이 즉각 로딩 4. **달력 월간 이동 시 카드 스택(Card Stack) 레이어 전환 애니메이션 구현 (`MainActivity.kt`, `activity_main.xml`)**: - 이전 달 화면이 하단에 베이스로 자연스럽게 깔리고(0.94x 축소 및 0.35 알파 페이드), 새 달 카드가 상단에서 부드럽게 감속 슬라이드 오버되는 끊김 없는 유체 모션 적용 5. **Android 14/15 호환 및 정식 서명키(release.jks) 적용**""" apk_path = "app/build/outputs/apk/release/app-release.apk" if not os.path.exists(apk_path): print(f"APK not found at {apk_path}") exit(1) print(f"Using APK at: {apk_path}") # Create Gitea Release url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases" headers = {"Authorization": f"token {token}", "Content-Type": "application/json"} data = json.dumps({"tag_name": tag, "name": title, "body": body, "draft": False, "prerelease": False}).encode('utf-8') req = urllib.request.Request(url, data=data, headers=headers, method="POST") with urllib.request.urlopen(req) as response: result = json.loads(response.read()) release_id = result["id"] print(f"Created Gitea Release successfully. Release ID: {release_id}") # Upload APK asset upload_url = f"https://git.webpluss.net/api/v1/repos/{owner_repo}/releases/{release_id}/assets" print(f"Uploading APK to {upload_url}...") curl_cmd = f'curl -s -X POST "{upload_url}?name=app.apk" -H "Authorization: token {token}" -F "attachment=@{apk_path}"' upload_result = subprocess.run(curl_cmd, shell=True, capture_output=True, text=True) print(f"Upload output: {upload_result.stdout}") upload_json = json.loads(upload_result.stdout) apk_uuid = upload_json.get("uuid") direct_url = upload_json.get("browser_download_url", f"https://git.webpluss.net/attachments/{apk_uuid}") # Copy APK to project root shutil.copy2(apk_path, "app.apk") print("Updated app.apk at project root.") # Update version.json v_info = { "versionCode": 105, "versionName": "1.0.5", "apkUrl": direct_url, "changelog": "v1.0.5: 메모 아이콘 정리, 삼성 최신 알람 화면 개편, 달력 초기 깜빡임 해소, 카드 스택 레이어 전환 애니메이션 적용", "forceUpdate": False } with open("version.json", "w", encoding="utf-8") as f: json.dump(v_info, f, ensure_ascii=False, indent=2) print(f"Updated version.json with apkUrl: {direct_url}") # Git commit and push cleanly in UTF-8 git_path = r"C:\Users\work\AppData\Roaming\MobaXterm\slash\mx86_64b\bin" os.environ["PATH"] = git_path + os.pathsep + os.environ.get("PATH", "") commit_msg = "v1.0.5 - 메모 아이콘 정리, 삼성 One UI 최신 알람 화면 개편, 달력 깜빡임 해소 및 카드 스택 전환 애니메이션 적용" subprocess.run(["git", "add", "."], check=True) subprocess.run(["git", "commit", "-m", commit_msg], check=True) subprocess.run(["git", "push", "origin", "main"], check=True) print("Git commit and push completed successfully!") print(f"Release {tag} process finished!")