mirror of
https://github.com/CodeSeeed/sbackup.git
synced 2026-10-03 18:32:58 +08:00
v2.0.0: 多目标备份 + S3云存储 + 完整性校验 + 9语言国际化
feat: v2.0.0 — 多目标备份 + S3云存储 + 审计日志 + 9语言国际化
This commit is contained in:
1 parent
c8c704a9c6
commit
8f2bcdf8fa
89 files changed
+37677
-1387
No files matched your search
@@ -0,0 +1,32 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [dev, main]
|
||||
pull_request:
|
||||
branches: [dev, main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ['3.10', '3.12']
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v3
|
||||
with:
|
||||
version: "latest"
|
||||
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
run: uv python install ${{ matrix.python-version }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: uv sync
|
||||
|
||||
- name: Run tests
|
||||
run: uv run pytest tests/ -q
|
||||
@@ -37,25 +37,52 @@ jobs:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install nuitka py7zr tqdm zstandard
|
||||
run: pip install nuitka py7zr tqdm zstandard paramiko minio reedsolo watchdog
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
shell: bash
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
shell: bash
|
||||
run: |
|
||||
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
||||
if [ -f "$NOTES_FILE" ]; then
|
||||
echo "HAS_NOTES=true" >> $GITHUB_OUTPUT
|
||||
# 使用 EOF 分隔符避免特殊字符问题
|
||||
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "HAS_NOTES=false" >> $GITHUB_OUTPUT
|
||||
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
python -m nuitka `
|
||||
--onefile `
|
||||
--assume-yes-for-downloads `
|
||||
--output-filename=sbackup.exe `
|
||||
--output-filename=sbackup-${{ steps.version.outputs.VERSION }}-windows-x64.exe `
|
||||
--include-package=sbackup `
|
||||
--include-data-dir=sbackup/locales=sbackup/locales `
|
||||
--include-package=py7zr `
|
||||
--include-package=tqdm `
|
||||
--include-package=zstandard `
|
||||
--include-package=paramiko `
|
||||
--include-package=minio `
|
||||
--include-package=reedsolo `
|
||||
--include-package=watchdog `
|
||||
main.py
|
||||
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: sbackup.exe
|
||||
body: ${{ steps.notes.outputs.NOTES }}
|
||||
files: sbackup-${{ steps.version.outputs.VERSION }}-windows-x64.exe
|
||||
|
||||
# 构建 macOS 可执行文件
|
||||
build-macos:
|
||||
@@ -68,25 +95,53 @@ jobs:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install nuitka py7zr tqdm zstandard
|
||||
run: pip install nuitka py7zr tqdm zstandard paramiko minio reedsolo watchdog
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Detect architecture
|
||||
id: arch
|
||||
run: echo "ARCH=$(uname -m)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
run: |
|
||||
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
||||
if [ -f "$NOTES_FILE" ]; then
|
||||
echo "HAS_NOTES=true" >> $GITHUB_OUTPUT
|
||||
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "HAS_NOTES=false" >> $GITHUB_OUTPUT
|
||||
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
python -m nuitka \
|
||||
--onefile \
|
||||
--assume-yes-for-downloads \
|
||||
--output-filename=sbackup-macos \
|
||||
--output-filename=sbackup-${{ steps.version.outputs.VERSION }}-macos-${{ steps.arch.outputs.ARCH }} \
|
||||
--include-package=sbackup \
|
||||
--include-data-dir=sbackup/locales=sbackup/locales \
|
||||
--include-package=py7zr \
|
||||
--include-package=tqdm \
|
||||
--include-package=zstandard \
|
||||
--include-package=paramiko \
|
||||
--include-package=minio \
|
||||
--include-package=reedsolo \
|
||||
--include-package=watchdog \
|
||||
main.py
|
||||
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: sbackup-macos
|
||||
body: ${{ steps.notes.outputs.NOTES }}
|
||||
files: sbackup-${{ steps.version.outputs.VERSION }}-macos-${{ steps.arch.outputs.ARCH }}
|
||||
|
||||
# 构建 Linux 可执行文件
|
||||
build-linux:
|
||||
@@ -99,22 +154,50 @@ jobs:
|
||||
python-version: '3.12'
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install nuitka py7zr tqdm zstandard
|
||||
run: pip install nuitka py7zr tqdm zstandard paramiko minio reedsolo watchdog
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Detect architecture
|
||||
id: arch
|
||||
run: echo "ARCH=$(uname -m)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Read release notes
|
||||
id: notes
|
||||
run: |
|
||||
NOTES_FILE="releases/v${{ steps.version.outputs.VERSION }}.md"
|
||||
if [ -f "$NOTES_FILE" ]; then
|
||||
echo "HAS_NOTES=true" >> $GITHUB_OUTPUT
|
||||
echo "NOTES<<EOF" >> $GITHUB_OUTPUT
|
||||
cat "$NOTES_FILE" >> $GITHUB_OUTPUT
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "HAS_NOTES=false" >> $GITHUB_OUTPUT
|
||||
echo "NOTES=Release v${{ steps.version.outputs.VERSION }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build executable
|
||||
run: |
|
||||
python -m nuitka \
|
||||
--onefile \
|
||||
--assume-yes-for-downloads \
|
||||
--output-filename=sbackup-linux \
|
||||
--output-filename=sbackup-${{ steps.version.outputs.VERSION }}-linux-${{ steps.arch.outputs.ARCH }} \
|
||||
--include-package=sbackup \
|
||||
--include-data-dir=sbackup/locales=sbackup/locales \
|
||||
--include-package=py7zr \
|
||||
--include-package=tqdm \
|
||||
--include-package=zstandard \
|
||||
--include-package=paramiko \
|
||||
--include-package=minio \
|
||||
--include-package=reedsolo \
|
||||
--include-package=watchdog \
|
||||
main.py
|
||||
|
||||
- name: Upload to Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: sbackup-linux
|
||||
body: ${{ steps.notes.outputs.NOTES }}
|
||||
files: sbackup-${{ steps.version.outputs.VERSION }}-linux-${{ steps.arch.outputs.ARCH }}
|
||||
Reference in new issue
Block a user