diff --git a/.github/workflows/release.yml b/.gitea/workflows/release.yml similarity index 60% rename from .github/workflows/release.yml rename to .gitea/workflows/release.yml index 9d62a97..e349eff 100644 --- a/.github/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -8,24 +8,30 @@ on: permissions: contents: write +# Self-contained: no external (GitHub-hosted) actions. Runs on a self-hosted +# Windows runner (label `windows`) that already has Python 3.12 on PATH. jobs: build: - runs-on: windows-latest + runs-on: windows steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' + - name: Checkout repository at tag + shell: pwsh + env: + TOKEN: ${{ github.token }} + run: | + $base = "${{ github.server_url }}" -replace '^https://', '' + $url = "https://oauth2:$env:TOKEN@$base/${{ github.repository }}.git" + git clone --depth 1 --branch "$env:GITHUB_REF_NAME" $url . - name: Install build dependencies run: python -m pip install --upgrade pip pyinstaller rich paramiko - name: Resolve version from tag id: ver - shell: bash - run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + shell: pwsh + run: | + $v = "$env:GITHUB_REF_NAME" -replace '^v', '' + "version=$v" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 - name: Build executable run: python -m PyInstaller --onefile --console --name vrcx --icon dev/assets/icon.ico --paths dev/src dev/vrcx-launcher.py @@ -75,10 +81,19 @@ jobs: "$hash $zip" | Out-File -FilePath "$zip.sha256" -Encoding ASCII -NoNewline Get-Content "$zip.sha256" - - name: Create release - uses: softprops/action-gh-release@v2 - with: - files: | - vrcx-portable-v${{ steps.ver.outputs.version }}.zip - vrcx-portable-v${{ steps.ver.outputs.version }}.zip.sha256 - generate_release_notes: true + - name: Publish Gitea release + shell: pwsh + env: + TOKEN: ${{ github.token }} + run: | + $ver = '${{ steps.ver.outputs.version }}' + $tag = "v$ver" + $api = "${{ github.server_url }}/api/v1/repos/${{ github.repository }}" + $hdr = @{ Authorization = "token $env:TOKEN" } + $body = @{ tag_name = $tag; name = $tag; draft = $false; prerelease = $false } | ConvertTo-Json + $rel = Invoke-RestMethod -Method Post -Uri "$api/releases" -Headers $hdr -ContentType 'application/json' -Body $body + $rid = $rel.id + foreach ($f in @("vrcx-portable-v$ver.zip", "vrcx-portable-v$ver.zip.sha256")) { + curl.exe -s -H "Authorization: token $env:TOKEN" -F "attachment=@$f" "$api/releases/$rid/assets?name=$f" | Out-Null + Write-Host "uploaded $f" + } diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml deleted file mode 100644 index 6b0cae7..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Bug report -description: Something doesn't work as expected -labels: ["bug"] -body: - - type: input - id: version - attributes: - label: Version - description: Visible in the startup banner. - placeholder: v0.1.0 - validations: - required: true - - - type: textarea - id: steps - attributes: - label: Steps to reproduce - placeholder: | - 1. ... - 2. ... - 3. ... - validations: - required: true - - - type: textarea - id: expected - attributes: - label: What you expected to happen - validations: - required: true - - - type: textarea - id: actual - attributes: - label: What actually happened - description: Paste any error output verbatim. Screenshots are welcome. - validations: - required: true - - - type: input - id: bmc_fw - attributes: - label: BMC firmware version (if relevant) - placeholder: e.g. YADRO VEGMAN Sx20 BMC Firmware v1.8r1389cd - - - type: textarea - id: extra - attributes: - label: Anything else? diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 1ed2f59..0000000 --- a/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,5 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: Security vulnerability - url: https://github.com/Engelgardt23/vrcx/security/advisories/new - about: Please report security issues privately via GitHub Security Advisories — not as a public issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml deleted file mode 100644 index 8ffd94f..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Feature request -description: Suggest a new feature or an improvement -labels: ["enhancement"] -body: - - type: textarea - id: motivation - attributes: - label: What's the use case? - validations: - required: true - - - type: textarea - id: proposal - attributes: - label: Proposed solution - validations: - required: true - - - type: textarea - id: alternatives - attributes: - label: Alternatives considered diff --git a/CHANGELOG.md b/CHANGELOG.md index f15763c..2213f12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,8 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and - Multi-BMC parallel collection over SSH, with the YADRO BMC CLI command set + raw shell + `cat` + `journalctl` + Redfish. - Output structure 1:1 with VRC v1.1b — same per-host `_bmcdump_` layout inside a single session `tar.gz`. - Full-screen rich-based TUI: per-host progress table + rolling events panel. -- Auto-update check on startup against GitHub `/releases/latest`. +- Auto-update check on startup against the Gitea instance `/releases/latest`. - MIT licensed. -[Unreleased]: https://github.com/Engelgardt23/vrcx/compare/v0.1.0...HEAD -[0.1.0]: https://github.com/Engelgardt23/vrcx/releases/tag/v0.1.0 +[Unreleased]: https://git.engelgardt23.ru/engel/vrcx/compare/v0.1.0...HEAD +[0.1.0]: https://git.engelgardt23.ru/engel/vrcx/releases/tag/v0.1.0 diff --git a/README.md b/README.md index 95e97ff..6e92010 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # vrcx -[![Latest release](https://img.shields.io/github/v/release/Engelgardt23/vrcx?include_prereleases&label=release)](https://github.com/Engelgardt23/vrcx/releases/latest) -[![Build](https://img.shields.io/github/actions/workflow/status/Engelgardt23/vrcx/release.yml?label=build)](https://github.com/Engelgardt23/vrcx/actions) +[![Latest release](https://img.shields.io/gitea/v/release/engel/vrcx?gitea_url=https%3A%2F%2Fgit.engelgardt23.ru&include_prereleases&label=release)](https://git.engelgardt23.ru/engel/vrcx/releases/latest) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Lang: en \| ru](https://img.shields.io/badge/lang-en%20%7C%20ru-blue)](#) @@ -22,7 +21,7 @@ The original VRC only touches the BMC. In real incidents support almost always a ## Download -Grab the latest release: [**releases page**](https://github.com/Engelgardt23/vrcx/releases/latest). +Grab the latest release: [**releases page**](https://git.engelgardt23.ru/engel/vrcx/releases/latest). The asset is `vrcx-portable-vX.Y.Z.zip`. ## Run @@ -86,7 +85,7 @@ Adding a new artefact = one line in the relevant table. ## Build from source ``` -git clone https://github.com/Engelgardt23/vrcx.git +git clone https://git.engelgardt23.ru/engel/vrcx.git cd vrcx python -m pip install rich paramiko pyinstaller python -m PyInstaller --onefile --console --name vrcx --icon dev/assets/icon.ico --paths dev/src dev/vrcx-launcher.py diff --git a/README.ru.md b/README.ru.md index 743afc5..bc11b92 100644 --- a/README.ru.md +++ b/README.ru.md @@ -1,7 +1,6 @@ # vrcx -[![Последний релиз](https://img.shields.io/github/v/release/Engelgardt23/vrcx?include_prereleases&label=release)](https://github.com/Engelgardt23/vrcx/releases/latest) -[![Сборка](https://img.shields.io/github/actions/workflow/status/Engelgardt23/vrcx/release.yml?label=build)](https://github.com/Engelgardt23/vrcx/actions) +[![Последний релиз](https://img.shields.io/gitea/v/release/engel/vrcx?gitea_url=https%3A%2F%2Fgit.engelgardt23.ru&include_prereleases&label=release)](https://git.engelgardt23.ru/engel/vrcx/releases/latest) [![Лицензия: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![Язык: en \| ru](https://img.shields.io/badge/lang-en%20%7C%20ru-blue)](#) @@ -22,7 +21,7 @@ ## Скачать -Последний релиз: [**страница релизов**](https://github.com/Engelgardt23/vrcx/releases/latest). +Последний релиз: [**страница релизов**](https://git.engelgardt23.ru/engel/vrcx/releases/latest). Архив: `vrcx-portable-vX.Y.Z.zip`. ## Запуск @@ -86,7 +85,7 @@ out/<ДДММГГГГ_ЧЧММСС>.tar.gz ← готовый бандл дл ## Сборка из исходников ``` -git clone https://github.com/Engelgardt23/vrcx.git +git clone https://git.engelgardt23.ru/engel/vrcx.git cd vrcx python -m pip install rich paramiko pyinstaller python -m PyInstaller --onefile --console --name vrcx --icon dev/assets/icon.ico --paths dev/src dev/vrcx-launcher.py diff --git a/dev/pyproject.toml b/dev/pyproject.toml index 8096552..56d67b3 100644 --- a/dev/pyproject.toml +++ b/dev/pyproject.toml @@ -13,8 +13,8 @@ dependencies = ["rich>=13", "paramiko>=3"] dynamic = ["version"] [project.urls] -Homepage = "https://github.com/Engelgardt23/vrcx" -Issues = "https://github.com/Engelgardt23/vrcx/issues" +Homepage = "https://git.engelgardt23.ru/engel/vrcx" +Issues = "https://git.engelgardt23.ru/engel/vrcx/issues" [project.scripts] vrcx = "vrcx.app:main" diff --git a/dev/src/vrcx/__init__.py b/dev/src/vrcx/__init__.py index f4c4ac1..09e272f 100644 --- a/dev/src/vrcx/__init__.py +++ b/dev/src/vrcx/__init__.py @@ -10,4 +10,4 @@ The single source of truth for the project version. Bump this before tagging a release; CI reads the tag, the code reads this constant.""" __version__ = "0.2.0-dev" -GITHUB_REPO = "engel/vrcx" # на Forgejo (git.engelgardt23.ru) +REPO = "engel/vrcx" # self-hosted Gitea (git.engelgardt23.ru) diff --git a/dev/src/vrcx/app.py b/dev/src/vrcx/app.py index aa63570..ea456ce 100644 --- a/dev/src/vrcx/app.py +++ b/dev/src/vrcx/app.py @@ -19,7 +19,7 @@ from rich.console import Console from rich.prompt import Confirm, Prompt from rich.table import Table -from . import __version__, GITHUB_REPO +from . import __version__, REPO from .bmc import BmcSession from .collector import collect_host from .config import load_config, Config @@ -170,7 +170,7 @@ def _print_header(console: Console) -> None: title = f"[bold cyan]vrcx v{__version__}[/] {t('tagline')}" latest = check_for_update() if latest: - release_url = f"https://git.engelgardt23.ru/{GITHUB_REPO}/releases/latest" + release_url = f"https://git.engelgardt23.ru/{REPO}/releases/latest" notice = t("update_available", tag=latest) header = Table.grid(expand=True) header.add_column(justify="left", ratio=1) diff --git a/dev/src/vrcx/update_check.py b/dev/src/vrcx/update_check.py index f24345c..745510e 100644 --- a/dev/src/vrcx/update_check.py +++ b/dev/src/vrcx/update_check.py @@ -1,16 +1,16 @@ """ Auto-update check. -On startup, ask GitHub for the latest release tag. If it's newer than the -local `__version__`, return the tag string — the caller renders a clickable -hint next to the title. Silent on any error (offline, rate-limit, etc.). +On startup, ask the Gitea instance for the latest release tag. If it's newer +than the local `__version__`, return the tag string — the caller renders a +clickable hint next to the title. Silent on any error (offline, rate-limit, etc.). """ from __future__ import annotations import json import urllib.request -from . import __version__, GITHUB_REPO +from . import __version__, REPO def _parse_version(s: str) -> tuple[int, int, int]: @@ -29,7 +29,7 @@ def check_for_update() -> str | None: the currently running version. Returns None when up-to-date, offline, rate-limited or on any error — caller decides how to render.""" try: - url = f"https://git.engelgardt23.ru/api/v1/repos/{GITHUB_REPO}/releases/latest" + url = f"https://git.engelgardt23.ru/api/v1/repos/{REPO}/releases/latest" req = urllib.request.Request(url, headers={ "User-Agent": f"vrcx/{__version__}", })