Release AimiliVPN V2.1 stable channel

This commit is contained in:
Aimili
2026-08-26 23:13:30 +08:00
parent c7aa86c86c
commit a9cf220500
11 changed files with 658 additions and 45 deletions
+95
View File
@@ -0,0 +1,95 @@
name: Publish formal release
on:
push:
tags:
- "v*"
permissions:
contents: write
packages: write
jobs:
test:
name: Test Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.11", "3.13"]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Verify version tag
shell: bash
run: test "${GITHUB_REF_NAME}" = "v$(tr -d '\r\n' < VERSION)"
- name: Compile Python sources
run: python -m py_compile vpngate_manager.py vpn_utils.py proxy_server.py snapshot_utils.py
- name: Validate installation script
run: bash -n install.sh
- name: Validate Docker Compose configuration
run: docker compose -f compose.yaml config >/dev/null
- name: Run unit tests
run: python -m unittest discover -s tests -v
release:
name: Build Linux release archives
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Build architecture-labelled archives
run: python scripts/build_release_archives.py --output-dir dist
- name: Create GitHub formal release
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
title="AimiliVPN V$(cut -d. -f1,2 VERSION) 正式版"
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
gh release upload "${GITHUB_REF_NAME}" dist/* --clobber --repo "${GITHUB_REPOSITORY}"
gh release edit "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" --title "${title}" --notes-file RELEASE_NOTES.md
else
gh release create "${GITHUB_REF_NAME}" dist/* --repo "${GITHUB_REPOSITORY}" --title "${title}" --notes-file RELEASE_NOTES.md --verify-tag
fi
docker:
name: Build multi-architecture Docker image
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: docker/setup-qemu-action@v4
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve image tags
id: version
shell: bash
run: |
version="${GITHUB_REF_NAME#v}"
minor="$(printf '%s' "${version}" | cut -d. -f1,2)"
echo "version=${version}" >> "${GITHUB_OUTPUT}"
echo "minor=${minor}" >> "${GITHUB_OUTPUT}"
- uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7
build-args: BUILD_VERSION=${{ steps.version.outputs.version }}
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.minor }}
ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: mode=max
sbom: true