feat: add probe json/stats and strengthen ci-release automation

This commit is contained in:
tianrking committed 2026-03-20 14:07:27 +08:00
1 parent e70e6c3b4c
commit bd0d6205ac
8 files changed
+413 -28

No files matched your search

+67
View File
@@ -43,3 +43,70 @@ jobs:
- name: Build release binaries
run: cargo build --release --workspace
linux-e2e-distros:
name: linux-e2e (${{ matrix.distro }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- distro: ubuntu-24.04
family: deb
image: ubuntu:24.04
- distro: debian-12
family: deb
image: debian:12
- distro: fedora-41
family: rpm
image: fedora:41
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run e2e in distro container
shell: bash
env:
DISTRO_IMAGE: ${{ matrix.image }}
DISTRO_FAMILY: ${{ matrix.family }}
run: |
set -euo pipefail
docker run --rm -e DISTRO_FAMILY="${DISTRO_FAMILY}" -v "$PWD:/work" -w /work "${DISTRO_IMAGE}" /bin/bash -lc '
set -euo pipefail
if [ "${DISTRO_FAMILY}" = "deb" ]; then
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y \
curl ca-certificates git build-essential pkg-config python3 python3-pip
else
dnf install -y \
curl ca-certificates git gcc gcc-c++ make pkgconf-pkg-config python3 python3-pip
fi
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain stable
export PATH="$HOME/.cargo/bin:$PATH"
rustup --version
cargo --version
pip3 install --no-input proxy.py pproxy
nohup python3 -m pproxy -l socks5://127.0.0.1:19080 >/tmp/pproxy-socks5.log 2>&1 &
nohup python3 -m proxy --hostname 127.0.0.1 --port 18080 >/tmp/proxy-http.log 2>&1 &
sleep 2
printf "%s\n" \
"dynamic_chain" \
"proxy_dns" \
"tcp_connect_time_out 3000" \
"tcp_read_time_out 8000" \
"[ProxyList]" \
"socks5 127.0.0.1 19080" \
"http 127.0.0.1 18080" > ci.e2e.conf
cargo run -p proxychains-bin -- -f ./ci.e2e.conf --probe
cargo run -p proxychains-bin -- -f ./ci.e2e.conf --probe --probe-json > probe-report.json
grep -q "\"summary\"" probe-report.json
PROXYCHAINS_TEST_SOCKS5_ADDR=127.0.0.1:19080 \
PROXYCHAINS_TEST_HTTP_ADDR=127.0.0.1:18080 \
cargo test -p proxychains --test real_backends -- --nocapture
'
+95
View File
@@ -96,15 +96,110 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout (for changelog generation)
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release-assets
- name: Generate checksums
shell: bash
run: |
set -euo pipefail
find release-assets -type f \( -name '*.tar.gz' -o -name '*.zip' -o -name '*.deb' \) -print0 \
| sort -z \
| xargs -0 sha256sum > SHA256SUMS.txt
- name: Generate release notes and changelog
shell: bash
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
PREV_TAG="$(git tag --sort=-creatordate | grep -v "^${TAG}$" | head -n1 || true)"
if [ -n "${PREV_TAG}" ]; then
RANGE="${PREV_TAG}..${TAG}"
else
RANGE="${TAG}"
fi
mapfile -t COMMITS < <(git log --no-merges --pretty=format:'%s' ${RANGE})
section() {
local name="$1"
shift
echo "### ${name}" >> CHANGELOG_AUTO.md
local found=0
for c in "${COMMITS[@]}"; do
for prefix in "$@"; do
if [[ "${c}" == ${prefix}* ]]; then
echo "- ${c}" >> CHANGELOG_AUTO.md
found=1
break
fi
done
done
if [ "${found}" -eq 0 ]; then
echo "- (none)" >> CHANGELOG_AUTO.md
fi
echo "" >> CHANGELOG_AUTO.md
}
{
echo "## Changelog (${TAG})"
echo ""
} > CHANGELOG_AUTO.md
section "Features" "feat:" "feature:"
section "Fixes" "fix:"
section "Docs" "docs:"
section "CI/Build" "ci:" "build:" "chore:"
echo "### Other" >> CHANGELOG_AUTO.md
OTHER_FOUND=0
for c in "${COMMITS[@]}"; do
if [[ "${c}" != feat:* && "${c}" != feature:* && "${c}" != fix:* && "${c}" != docs:* && "${c}" != ci:* && "${c}" != build:* && "${c}" != chore:* ]]; then
echo "- ${c}" >> CHANGELOG_AUTO.md
OTHER_FOUND=1
fi
done
if [ "${OTHER_FOUND}" -eq 0 ]; then
echo "- (none)" >> CHANGELOG_AUTO.md
fi
echo "" >> CHANGELOG_AUTO.md
cat > RELEASE_NOTES.md <<EOF
## proxychains-rs ${TAG}
### Minimal Usage
\`\`\`bash
# Linux/macOS
./proxychains4 -f ./proxychains.conf --probe
./proxychains4 -f ./proxychains.conf curl https://ifconfig.me
# Windows
.\\proxychains4.exe -f .\\proxychains.conf --probe
.\\proxychains4.exe -f .\\proxychains.conf curl https://ifconfig.me
\`\`\`
### Assets
- Windows zip (\`proxychains4.exe\`, \`proxychains.dll\`)
- Linux tar.gz
- Linux deb
- macOS tar.gz
- SHA256 checksums: \`SHA256SUMS.txt\`
EOF
cat CHANGELOG_AUTO.md >> RELEASE_NOTES.md
- name: Publish release assets
uses: softprops/action-gh-release@v2
with:
body_path: RELEASE_NOTES.md
files: |
release-assets/**/*.tar.gz
release-assets/**/*.zip
release-assets/**/*.deb
SHA256SUMS.txt