From: MaxSMokeSkaarj Date: Fri, 9 May 2025 15:36:47 +0000 (+1000) Subject: Автообновление SS14 X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=942abd90957378849fdf42799aca19fedffe5f37;p=space-station-14.git Автообновление SS14 --- diff --git a/.github/workflows/publish-local.yml b/.github/workflows/publish-local.yml deleted file mode 100644 index 13b0fd67e9..0000000000 --- a/.github/workflows/publish-local.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Publish - -concurrency: - group: publish - -on: [push] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y python3-paramiko python3-lxml python3-requests python3-yaml - - - uses: actions/checkout@v3.6.0 - with: - submodules: 'recursive' - - name: Setup .NET Core - uses: actions/setup-dotnet@v3.2.0 - with: - dotnet-version: 9.0.x - - - name: Get Engine Tag - run: | - cd RobustToolbox - git fetch --depth=1 - - - name: Install dependencies - run: dotnet restore - - - name: Build Packaging - run: dotnet build Content.Packaging --configuration Release --no-restore /m - - - name: Package server - run: dotnet run --project Content.Packaging server --platform win-x64 --platform linux-x64 --platform osx-x64 --platform linux-arm64 - - - name: Package client - run: dotnet run --project Content.Packaging client --no-wipe-release - - - name: Publish version - run: Tools/publish_multi_request_local.py - env: - PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} - GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }} - - - name: Publish changelog (Discord) - run: Tools/actions_changelogs_since_last_run.py - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DISCORD_WEBHOOK_URL: ${{ secrets.CHANGELOG_DISCORD_WEBHOOK }} - - - name: Publish changelog (RSS) - run: Tools/actions_changelog_rss.py - env: - CHANGELOG_RSS_KEY: ${{ secrets.CHANGELOG_RSS_KEY }} diff --git a/Tools/publish_multi_request_local.py b/Tools/publish_multi_request_local.py deleted file mode 100755 index 75630dbf74..0000000000 --- a/Tools/publish_multi_request_local.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/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"] - -RELEASE_DIR = "release" - -# -# CONFIGURATION PARAMETERS -# Forks should change these to publish to their own infrastructure. -# -ROBUST_CDN_URL = "http://192.168.1.2:27690/" -FORK_ID = "main" - -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: - 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()