Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dafb6aba1b | |||
| 3e967d7bed | |||
| c75207f8e1 | |||
| 3871dc8677 | |||
| 72dc9b238f |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -15,3 +15,4 @@
|
|||||||
.externalNativeBuild
|
.externalNativeBuild
|
||||||
.cxx
|
.cxx
|
||||||
local.properties
|
local.properties
|
||||||
|
.history/
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"latest_version": "3.6.2-01",
|
"latest_version": "3.6.2-04",
|
||||||
"changelog": "UPDATE: Update to 3.6.52",
|
"changelog": "UPDATE: New res",
|
||||||
"apk_url": "https://cloud.kain.id.vn/seafhttp/f/7a7d79a5354e4d39976f/?op=view"
|
"apk_url": "https://git.kain.io.vn/Firefly-Shelter/FireflyGo_Android/releases/download/3.6.2-04/firefly_go_android.apk"
|
||||||
}
|
}
|
||||||
@@ -2,20 +2,20 @@
|
|||||||
"leader": 0,
|
"leader": 0,
|
||||||
"lineups": {
|
"lineups": {
|
||||||
"0": 1413,
|
"0": 1413,
|
||||||
"1": 1403,
|
"1": 1415,
|
||||||
"2": 1409,
|
"2": 1409,
|
||||||
"3": 1407
|
"3": 1407
|
||||||
},
|
},
|
||||||
"position": {
|
"position": {
|
||||||
"x": -30,
|
"x": 218004,
|
||||||
"z": -22750,
|
"z": 259263,
|
||||||
"y": -15000,
|
"y": 53915,
|
||||||
"rot_y": 234288
|
"rot_y": 79863
|
||||||
},
|
},
|
||||||
"scene": {
|
"scene": {
|
||||||
"plane_id": 10000,
|
"plane_id": 20423,
|
||||||
"floor_id": 10000003,
|
"floor_id": 20423001,
|
||||||
"entry_id": 100000352
|
"entry_id": 2042301
|
||||||
},
|
},
|
||||||
"player_outfit": [
|
"player_outfit": [
|
||||||
1001
|
1001
|
||||||
@@ -145,12 +145,19 @@
|
|||||||
},
|
},
|
||||||
"theory_craft": {
|
"theory_craft": {
|
||||||
"hp": {
|
"hp": {
|
||||||
"1": 600000,
|
"1": [
|
||||||
"2": 10000000
|
200000,
|
||||||
|
1000000,
|
||||||
|
200000
|
||||||
|
],
|
||||||
|
"2": [
|
||||||
|
500000,
|
||||||
|
10000000,
|
||||||
|
500000
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"cycle_count": 1,
|
"cycle_count": 1,
|
||||||
"log": false,
|
"mode": true
|
||||||
"mode": false
|
|
||||||
},
|
},
|
||||||
"profile_data": {
|
"profile_data": {
|
||||||
"cur_chat_bubble_id": 220008,
|
"cur_chat_bubble_id": 220008,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
|||||||
# Android operating system, and which are packaged with your app's APK
|
# Android operating system, and which are packaged with your app's APK
|
||||||
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.enableJetifier=true
|
android.enableJetifier=false
|
||||||
# Kotlin code style for this project: "official" or "obsolete":
|
# Kotlin code style for this project: "official" or "obsolete":
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
# Enables namespacing of each library's R class so that its R class includes only the
|
# Enables namespacing of each library's R class so that its R class includes only the
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:5334f2dbde52cf6c2a2a0152a3b2250bc217a19036d3607ce81a9b84ff1c69d0
|
oid sha256:87408dc51a2862b36217129b2a675518705b4b69bbf33b8a6c876b0bdefb91b9
|
||||||
size 89535421
|
size 89628224
|
||||||
|
|||||||
2
script/.gitignore
vendored
Normal file
2
script/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
.env
|
||||||
|
*.exe
|
||||||
2
script/README_Note.md
Normal file
2
script/README_Note.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Changelog
|
||||||
|
## - UPDATE: New res
|
||||||
5
script/go.mod
Normal file
5
script/go.mod
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
module release
|
||||||
|
|
||||||
|
go 1.25.0
|
||||||
|
|
||||||
|
require github.com/joho/godotenv v1.5.1
|
||||||
2
script/go.sum
Normal file
2
script/go.sum
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
|
||||||
|
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
|
||||||
154
script/main.go
Normal file
154
script/main.go
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"mime/multipart"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
"github.com/joho/godotenv"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
repoOwner = "Firefly-Shelter"
|
||||||
|
repoName = "FireflyGo_Android"
|
||||||
|
giteaURL = "https://git.kain.io.vn"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ReleaseInput struct {
|
||||||
|
TagName string `json:"tag_name"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Body string `json:"body"`
|
||||||
|
Draft bool `json:"draft"`
|
||||||
|
Prerelease bool `json:"prerelease"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type ReleaseResponse struct {
|
||||||
|
ID int `json:"id"`
|
||||||
|
HTMLURL string `json:"html_url"`
|
||||||
|
URL string `json:"url"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func readFile(path string) string {
|
||||||
|
data, err := os.ReadFile(path)
|
||||||
|
if err != nil {
|
||||||
|
panic(fmt.Sprintf("Failed to read %s: %v", path, err))
|
||||||
|
}
|
||||||
|
return string(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
err := godotenv.Load("script/.env")
|
||||||
|
if err != nil {
|
||||||
|
fmt.Println("Error loading .env file")
|
||||||
|
}
|
||||||
|
|
||||||
|
token := os.Getenv("TOKEN")
|
||||||
|
if token == "" {
|
||||||
|
fmt.Println("TOKEN not found in .env")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
releaseJSON := readFile("script/release.json")
|
||||||
|
var meta map[string]string
|
||||||
|
if err := json.Unmarshal([]byte(releaseJSON), &meta); err != nil {
|
||||||
|
panic("Invalid release.json")
|
||||||
|
}
|
||||||
|
tag := meta["tag"]
|
||||||
|
title := meta["title"]
|
||||||
|
body := readFile("script/README_Note.md")
|
||||||
|
|
||||||
|
// Step 1: Create release
|
||||||
|
releaseInput := ReleaseInput{
|
||||||
|
TagName: tag,
|
||||||
|
Name: title,
|
||||||
|
Body: body,
|
||||||
|
Draft: false,
|
||||||
|
Prerelease: false,
|
||||||
|
}
|
||||||
|
payload, _ := json.Marshal(releaseInput)
|
||||||
|
|
||||||
|
req, _ := http.NewRequest("POST",
|
||||||
|
fmt.Sprintf("%s/api/v1/repos/%s/%s/releases", giteaURL, repoOwner, repoName),
|
||||||
|
bytes.NewReader(payload),
|
||||||
|
)
|
||||||
|
req.Header.Set("Authorization", "token "+token)
|
||||||
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode != http.StatusCreated {
|
||||||
|
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||||
|
panic(fmt.Sprintf("Failed to create release: %s", bodyBytes))
|
||||||
|
}
|
||||||
|
|
||||||
|
var releaseResp ReleaseResponse
|
||||||
|
if err := json.NewDecoder(resp.Body).Decode(&releaseResp); err != nil {
|
||||||
|
panic("Failed to decode release response")
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Release created:\n- ID: %d\n- HTML: %s\n", releaseResp.ID, releaseResp.HTMLURL)
|
||||||
|
|
||||||
|
uploadURL := releaseResp.URL
|
||||||
|
if uploadURL == "" {
|
||||||
|
panic("url missing in release response")
|
||||||
|
}
|
||||||
|
|
||||||
|
files, err := os.ReadDir("app/release")
|
||||||
|
if err != nil {
|
||||||
|
panic("Cannot read prebuild folder")
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, file := range files {
|
||||||
|
if filepath.Ext(file.Name()) != ".apk" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
uploadPath := filepath.Join("app/release", file.Name())
|
||||||
|
fmt.Println("Uploading:", uploadPath)
|
||||||
|
|
||||||
|
buf := new(bytes.Buffer)
|
||||||
|
writer := multipart.NewWriter(buf)
|
||||||
|
part, err := writer.CreateFormFile("attachment", filepath.Base(uploadPath))
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Failed to create form: %v\n", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
src, err := os.Open(uploadPath)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Cannot open file %s: %v\n", file.Name(), err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
io.Copy(part, src)
|
||||||
|
src.Close()
|
||||||
|
writer.Close()
|
||||||
|
|
||||||
|
req, err := http.NewRequest("POST", uploadURL+"/assets", buf)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("NewRequest error: %v\n", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
req.Header.Set("Authorization", "token "+token)
|
||||||
|
req.Header.Set("Content-Type", writer.FormDataContentType())
|
||||||
|
|
||||||
|
resp, err := http.DefaultClient.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Upload failed: %v\n", err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if resp.StatusCode != http.StatusCreated {
|
||||||
|
bodyBytes, _ := io.ReadAll(resp.Body)
|
||||||
|
fmt.Printf("Upload failed: %s\n", bodyBytes)
|
||||||
|
} else {
|
||||||
|
fmt.Println("Uploaded:", file.Name())
|
||||||
|
}
|
||||||
|
resp.Body.Close()
|
||||||
|
}
|
||||||
|
}
|
||||||
5
script/release.json
Normal file
5
script/release.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"tag": "3.6.2-04",
|
||||||
|
"title": "PreBuild Version 3.6.52 - 04"
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user