vpnbot-xray-patches/.forgejo/workflows/ci.yml
loop-uh fa7515ce5c
All checks were successful
Follow official Xray dev releases / candidate (push) Successful in 43s
Test and build VPnBot Xray patches / test-and-build (push) Successful in 3m28s
Выпуск Xray: ci.yml считает патчи по patches/series, а не «ровно три»
db2a118 добавил четвёртый патч и убрал зашитое число из release_pipeline.py
и prepare-source.sh, но проверка границы репозитория в ci.yml осталась
«test … -eq 3»: оба прогона ci.yml на db2a118 упали за 49 с на этом шаге
(candidate.yml того же коммита прошёл целиком и выпустил
v26.11.9-vpnbot.2-candidate.1). Теперь число файлов patches/*.patch
сравнивается с числом строк series — тем же правилом, что у
prepare-source.sh.

Проверено: на этом дереве 4 файла и 4 строки, условие истинно; YAML
разбирается.

Claude-Session: 97b842d2-0b49-46c0-93cf-f06287d52a5b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:55:36 -05:00

83 lines
3.2 KiB
YAML

name: Test and build VPnBot Xray patches
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test-and-build:
runs-on: linux
timeout-minutes: 90
steps:
- name: Checkout the patch repository
uses: https://data.forgejo.org/actions/checkout@v6
with:
persist-credentials: false
- name: Install packaging tools
run: |
set -euo pipefail
apt-get update
apt-get install -y --no-install-recommends ca-certificates curl git openssl python3 unzip zip
# The same discovery as candidate.yml owns the official source: CI tests
# the patches against the release the train will build, not a manual pin.
- name: Resolve the newest official Xray release
id: discover
run: |
set -euo pipefail
python3 scripts/release_pipeline.py discover \
--forgejo-releases-url "${FORGEJO_API_URL}/repos/${FORGEJO_REPOSITORY}/releases" \
--output-env candidate.env \
--output-metadata candidate-metadata.json
set -a
source candidate.env
set +a
printf 'go_version=%s\n' "$GO_VERSION" >> "$FORGEJO_OUTPUT"
- name: Set up the Go version required by official Xray
uses: https://data.forgejo.org/actions/setup-go@v6
with:
go-version: ${{ steps.discover.outputs.go_version }}
cache: false
- name: Validate the repository boundary
run: |
set -euo pipefail
git diff --check -- . ':!patches/*.patch'
bash -n scripts/prepare-source.sh scripts/test-patches.sh scripts/build-release.sh scripts/install_promoter.sh
python3 -m py_compile scripts/release_pipeline.py scripts/canary_active_revoke.py scripts/pilot_and_promote.py scripts/release_alert_monitor.py scripts/check_no_mptcp_listener.py
python3 -m unittest discover -s tests -p 'test_*.py'
# Every patch file is in patches/series and nothing else is: the series is the one count.
test "$(find patches -maxdepth 1 -type f -name '*.patch' | wc -l)" -eq "$(grep -c '[^[:space:]]' patches/series)"
if git grep -n -I -E -- 'git\.zapret\.moe/.+Xray-core|github\.com/(youtubediscord|zapretdiscordyoutube)/Xray-core'; then
echo 'A retired full Xray fork is referenced' >&2
exit 1
fi
if git grep -n -I -E -- 'api\.github\.com|raw\.githubusercontent\.com' -- scripts/release_pipeline.py; then
echo 'Release discovery must use the official Atom feed and Git tag, not GitHub API/raw endpoints' >&2
exit 1
fi
- name: Apply and test the patches on official XTLS source
env:
VPNBOT_BUILD_ENV_FILE: candidate.env
run: scripts/test-patches.sh
- name: Build Linux release archives
env:
VPNBOT_BUILD_ENV_FILE: candidate.env
run: scripts/build-release.sh release-assets
- name: Upload the exact release candidates
uses: https://data.forgejo.org/forgejo/upload-artifact@v4
with:
name: vpnbot-xray-linux
path: release-assets/
retention-days: 7