70 lines
3.3 KiB
Python
Executable File
70 lines
3.3 KiB
Python
Executable File
import urllib.request
|
|
import json
|
|
import os
|
|
import subprocess
|
|
import shutil
|
|
|
|
token = "e3b515eaa0a6683c921ca3bf718e281ed30a6075"
|
|
owner_repo = "sanjeok77/ShiftRing"
|
|
tag = "v1.0.1"
|
|
title = "v1.0.1 - 알람 반복 횟수 선택 버그 수정, 달력 상단 연장근무 인디고 컬러 개편, 알람 그룹 아코디언 & +/x 부드러운 회전 애니메이션 적용"
|
|
body = """## 🚀 ShiftRing v1.0.1 릴리즈
|
|
|
|
### 🌟 주요 변경 및 버그 수정 사항
|
|
1. **알람 수정 다이얼로그 반복 횟수 선택 버그 수정**:
|
|
- 알람 수정 및 추가 화면에서 반복 횟수(3회 / 5회 / 계속) 선택이 즉시 반영되고 저장되도록 클릭 리스너 및 UI 갱신 로직 완벽 복구
|
|
2. **달력 메인 상단 연장근무 표시 컬러 인디고(#5856D6) 개편**:
|
|
- 휴무/휴가 붉은색(`shift_red`)과 혼동되지 않도록 또렷하고 세련된 One UI 인디고(`bg_chip_soft_overtime.xml`) 칩 스타일로 변경
|
|
3. **알람 그룹 접기/펼치기 아코디언 & 회전 애니메이션 적용**:
|
|
- 알람 그룹 헤더 터치 시 `AutoTransition` 기반 부드러운 아코디언 높이/투명도 애니메이션 적용
|
|
- 접힘/열림 상태에 따라 `+` (0도) ↔ `x` (45도) 아이콘이 유체 감속 곡선(`PathInterpolator(0.22, 1, 0.36, 1)`)으로 매끄럽게 회전 전환되도록 구현
|
|
4. **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()
|
|
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": 101,
|
|
"versionName": "1.0.1",
|
|
"apkUrl": direct_url,
|
|
"changelog": "v1.0.1: 알람 반복 횟수 선택 버그 수정, 달력 상단 연장근무 인디고 컬러 개편, 알람 그룹 아코디언 및 +/x 회전 애니메이션 적용",
|
|
"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}")
|
|
print(f"Release {tag} process finished!")
|