Files
ss14-wl/Tools/publish_multi_request.py
LEVELcat 1d4ba544cc Merge branch 'fixUPWL3' of https://github.com/Litogin/Ho
# Resolved Conflicts:
#	Content.Client/Sprite/ContentSpriteSystem.cs
#	Content.Server/Corvax/StationGoal/StationGoalCommand.cs
#	Content.Server/Corvax/StationGoal/StationGoalPaperSystem.cs
#	Content.Server/GameTicking/GameTicker.Spawning.cs
#	Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs
#	Content.Server/Silicons/Borgs/BorgSystem.cs
#	Content.Shared.Database/LogType.cs
#	Content.Shared/Preferences/HumanoidCharacterProfile.cs
#	Resources/Audio/Magic/attributions.yml
#	Resources/Changelog/ChangelogSyndie.yml
#	Resources/Credits/GitHub.txt
#	Resources/Locale/ru-RU/guidebook/guides.ftl
#	Resources/Prototypes/Actions/types.yml
#	Resources/Prototypes/Catalog/VendingMachines/Inventories/games.yml
#	Resources/Prototypes/Entities/Structures/Machines/base_structuremachines.yml
#	Resources/Prototypes/Entities/Structures/Machines/lathe.yml
#	Resources/Prototypes/Entities/Structures/Power/apc.yml
#	Resources/Prototypes/Entities/Structures/Power/substation.yml
#	Resources/Prototypes/Research/experimental.yml
#	Resources/Prototypes/Roles/Jobs/Cargo/cargo_technician.yml
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodbartender.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodbartender.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodbartender.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcaptain.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcaptain.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcaptain.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcargo.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcargo.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcargo.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodce.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodce.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodce.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcentcom.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcentcom.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcentcom.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodchemist.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodchemist.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodchemist.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcmo.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcmo.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodcmo.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hooddefault.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hooddefault.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hooddefault.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodengi.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodengi.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodengi.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhop.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhop.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhop.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhos.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhos.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhos.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhydro.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhydro.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodhydro.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodjani.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodjani.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodjani.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodmed.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodmed.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodmed.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodminer.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodminer.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodminer.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodpara.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodpara.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodpara.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodqm.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodqm.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodqm.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodrd.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodrd.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodrd.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodrobo.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodrobo.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodrobo.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsci.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsci.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsci.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsec.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsec.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsec.rsi/meta.json
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsyndicate.rsi/equipped-HELMET.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsyndicate.rsi/icon.png
#	Resources/Textures/Clothing/Head/Hoods/Coat/hoodsyndicate.rsi/meta.json
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/ATMOS-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/BAR-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/BAR-icon.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/CAP-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/CARGO-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/CE-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/CENTCOM-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/CHEM-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/CMO-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/ENGI-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/GENE-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/HOP-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/HYDRO-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/JANI-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/MED-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/MINER-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/PARA-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/QM-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/RD-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/ROBO-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/SCI-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/SYNDIE-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/VIRO-equipped-OUTERCLOTHING.png
#	Resources/Textures/Clothing/OuterClothing/WinterCoats/coat.rsi/equipped-OUTERCLOTHING.png
2025-04-05 16:17:55 +03:00

89 lines
2.3 KiB
Python
Executable File

#!/usr/bin/env python3
import argparse
import requests
import os
import subprocess
from typing import Iterable
PUBLISH_TOKEN = os.environ["PUBLISH_TOKEN"]
VERSION = os.environ["GITHUB_SHA"]
FORK_ID = os.environ['FORK_ID']
RELEASE_DIR = "release"
#
# CONFIGURATION PARAMETERS
# Forks should change these to publish to their own infrastructure.
#
ROBUST_CDN_URL = "https://cdn.station14.ru/"
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--fork-id", default=FORK_ID)
args = parser.parse_args()
fork_id = args.fork_id
session = requests.Session()
session.headers = {
"Authorization": f"Bearer {PUBLISH_TOKEN}",
}
print(f"Starting publish on Robust.Cdn for version {VERSION}")
data = {
"version": VERSION,
"engineVersion": get_engine_version(),
}
headers = {
"Content-Type": "application/json"
}
resp = session.post(f"{ROBUST_CDN_URL}fork/{fork_id}/publish/start", json=data, headers=headers)
resp.raise_for_status()
print("Publish successfully started, adding files...")
for file in get_files_to_publish():
print(f"Publishing {file}")
with open(file, "rb") as f:
headers = {
"Content-Type": "application/octet-stream",
"Robust-Cdn-Publish-File": os.path.basename(file),
"Robust-Cdn-Publish-Version": VERSION
}
resp = session.post(f"{ROBUST_CDN_URL}fork/{fork_id}/publish/file", data=f, headers=headers)
resp.raise_for_status()
print("Successfully pushed files, finishing publish...")
data = {
"version": VERSION
}
headers = {
"Content-Type": "application/json"
}
resp = session.post(f"{ROBUST_CDN_URL}fork/{fork_id}/publish/finish", json=data, headers=headers)
resp.raise_for_status()
print("SUCCESS!")
def get_files_to_publish() -> Iterable[str]:
for file in os.listdir(RELEASE_DIR):
yield os.path.join(RELEASE_DIR, file)
def get_engine_version() -> str:
## ToRemove-start
return "239.0.1"
## ToRemove-end
proc = subprocess.run(["git", "describe","--tags", "--abbrev=0"], stdout=subprocess.PIPE, cwd="RobustToolbox", check=True, encoding="UTF-8")
tag = proc.stdout.strip()
assert tag.startswith("v")
return tag[1:] # Cut off v prefix.
if __name__ == '__main__':
main()