Files
FoFreeXit/.github/workflows/build-windows.yml
T
adminandClaude Fable 5 fd731255ac
Build Windows portable / build (push) Canceled after 0s
Form XObject vòng 2: rút object khỏi form thật sự — sửa trong form mới được LƯU
CI vòng 1 bắt đúng lỗi thiết kế: FPDFText_SetText trên con trong form KHÔNG
đánh dấu dirty_streams của form (chỉ RemovePageObject/InsertPageObjectAtIndex
mới làm — xem cpdf_pageobjectholder.cpp) nên mọi sửa in-place trong form
không bao giờ được ghi ra file. Test canary fail chính xác ở điểm này.

- Đổi feature pdfium-render pdfium_latest(7543) -> pdfium_7350 (cả ff-engine
  lẫn app): mở remove_object cho Form XObject qua blanket impl
  PdfPageObjectsCommon (wrapper 0.8.37 sót gate 7543 dù binding có đủ);
  API 7350 là subset của DLL bblanchon mới, đã quét 0 hàm 7543-only.
- Mọi sửa/xoá con trong form = RÚT THẬT khỏi form (FPDFFormObj_RemoveObject,
  thứ tự path sâu trước + cùng cha con lớn trước) -> form dirty -> ProcessForm
  regenerate stream khi lưu. SetText con trong form = SetTextMode mới
  NestedRecreate: rút khỏi form + tạo lại ở cấp trang giữ font gốc qua token
  (probe như tầng 0 reflow; thiếu glyph -> nhúng lại bytes/cùng họ), matrix
  đã compose.
- CI test thêm --test-threads=1: PDFium serialize qua 1 mutex toàn cục,
  1 test panic khi giữ lock poison mutex làm 17 test song song chết oan.
Docs cập nhật theo (12-phase4-summary.md Iteration 4).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-08 02:00:10 +07:00

87 lines
2.8 KiB
YAML

name: Build Windows portable
on:
workflow_dispatch: {}
push:
branches: [main]
paths:
- "app/**"
- "crates/**"
- "Cargo.lock"
- "scripts/fetch-pdfium.ps1"
- "scripts/fetch-qpdf.ps1"
- ".github/workflows/build-windows.yml"
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
app/src-tauri/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Fetch PDFium (Windows x64)
shell: pwsh
run: powershell -ExecutionPolicy Bypass -File scripts/fetch-pdfium.ps1
- name: Fetch QPDF (Windows x64)
shell: pwsh
run: powershell -ExecutionPolicy Bypass -File scripts/fetch-qpdf.ps1
# Máy dev không có Rust — CI là nơi duy nhất chạy test engine.
# Fail test = fail build, không publish bản hỏng.
# --test-threads=1: PDFium serialize qua 1 mutex toàn cục; 1 test panic
# khi đang giữ lock sẽ poison mutex làm mọi test song song chết oan.
- name: Run engine tests
run: cargo test -p ff-engine -- --test-threads=1
- name: Build release
working-directory: app/src-tauri
run: cargo build --release
- name: Assemble portable folder
shell: pwsh
run: |
$dist = "dist/FoFreeXit"
New-Item -ItemType Directory -Force -Path $dist | Out-Null
Copy-Item "app/src-tauri/target/release/fofreexit-app.exe" "$dist/FoFreeXit.exe"
Copy-Item "pdfium.dll" "$dist/pdfium.dll"
Copy-Item "qpdf/bin/*.exe" "$dist/"
Copy-Item "qpdf/bin/*.dll" "$dist/"
Copy-Item "scripts/portable-readme.txt" "$dist/DOC-doc-truoc-khi-chay.txt"
Compress-Archive -Path "$dist/*" -DestinationPath "FoFreeXit-portable-win64.zip" -Force
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: FoFreeXit-portable-win64
path: FoFreeXit-portable-win64.zip
retention-days: 30
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: win-build-${{ github.run_number }}
name: "FoFreeXit Windows portable (build ${{ github.run_number }})"
body: |
Ban build Windows portable tu dong (khong can cai Rust/Visual Studio).
Giai nen `FoFreeXit-portable-win64.zip` roi chay `FoFreeXit.exe`.
Commit: ${{ github.sha }}
files: FoFreeXit-portable-win64.zip
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}