mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-28 07:57:38 +01:00
CI: improve more ci worflow
This commit is contained in:
10
.github/workflows/nightly.yml
vendored
10
.github/workflows/nightly.yml
vendored
@@ -16,12 +16,12 @@ jobs:
|
|||||||
runs-on: macos-26
|
runs-on: macos-26
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
# - uses: actions/checkout@v4
|
||||||
with:
|
# with:
|
||||||
submodules: recursive
|
# submodules: recursive
|
||||||
fetch-depth: 0
|
# fetch-depth: 0
|
||||||
|
|
||||||
- run: brew install ldid xcbeautify
|
# - run: brew install ldid xcbeautify
|
||||||
|
|
||||||
# --------------------------------------------------
|
# --------------------------------------------------
|
||||||
# runtime env setup
|
# runtime env setup
|
||||||
|
|||||||
@@ -64,13 +64,21 @@ def reserve_build_number(repo, max_attempts=5):
|
|||||||
version_json = repo / "version.json"
|
version_json = repo / "version.json"
|
||||||
|
|
||||||
def utc_now():
|
def utc_now():
|
||||||
return datetime.datetime.now(datetime.UTC)\
|
return datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%SZ")
|
||||||
.strftime("%Y-%m-%dT%H:%M:%SZ")
|
|
||||||
|
|
||||||
def read():
|
def read():
|
||||||
if not version_json.exists():
|
if not version_json.exists():
|
||||||
return {"build": 0, "issued_at": utc_now()}
|
branch = runAndGet("git rev-parse --abbrev-ref HEAD", cwd=repo)
|
||||||
return json.loads(version_json.read_text())
|
|
||||||
|
data = {
|
||||||
|
"build": 0,
|
||||||
|
"issued_at": utc_now(),
|
||||||
|
"tag": branch,
|
||||||
|
}
|
||||||
|
version_json.write_text(json.dumps(data, indent=2) + "\n")
|
||||||
|
return data
|
||||||
|
|
||||||
|
return json.loads(version_json.read_text())
|
||||||
|
|
||||||
def write(data):
|
def write(data):
|
||||||
version_json.write_text(json.dumps(data, indent=2) + "\n")
|
version_json.write_text(json.dumps(data, indent=2) + "\n")
|
||||||
@@ -86,11 +94,7 @@ def reserve_build_number(repo, max_attempts=5):
|
|||||||
write(data)
|
write(data)
|
||||||
|
|
||||||
run("git add version.json", check=False, cwd=repo)
|
run("git add version.json", check=False, cwd=repo)
|
||||||
run(
|
run(f"git commit -m '{data['tag']} - build no: {data['build']}' || true", check=False, cwd=repo)
|
||||||
f"git commit -m '{data['tag']} - build no: {data['build']}' || true",
|
|
||||||
check=False,
|
|
||||||
cwd=repo,
|
|
||||||
)
|
|
||||||
|
|
||||||
rc = subprocess.call("git push", shell=True, cwd=repo)
|
rc = subprocess.call("git push", shell=True, cwd=repo)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user