فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

ci(release): require phase-A signoffs before Windows installer publication

davoodmehraban89 committed Oct 14, 2026 at 23:50 UTC a9f187da89afd787cc1021f24f125c21b9445e19
1 file changed +89
.github/workflows/phase-a-public-release.yml new
+89
@@ -0,0 +1,89 @@
1 +name: Publish verified Phase A Windows release
2 +on:
3 + workflow_dispatch:
4 + inputs:
5 + release_tag:
6 + description: 'Exact tag matching package and Tauri versions (e.g. v2.2.0)'
7 + required: true
8 + type: string
9 +permissions:
10 + contents: write
11 +concurrency:
12 + group: phase-a-public-release
13 + cancel-in-progress: false
14 +jobs:
15 + release-gate:
16 + runs-on: ubuntu-latest
17 + timeout-minutes: 25
18 + outputs:
19 + release_tag: ${{ steps.ready.outputs.release_tag }}
20 + steps:
21 + - uses: actions/checkout@v4
22 + with:
23 + persist-credentials: false
24 + - uses: actions/setup-node@v4
25 + with:
26 + node-version: '22'
27 + cache: npm
28 + - run: npm ci
29 + - name: Verify ALL production acceptance evidence and consistent version
30 + run: node scripts/verify-phase-a-release.mjs "${{ inputs.release_tag }}"
31 + - name: Run the full accounting, backup and security tests
32 + run: npm test
33 + - name: Verify frontend and production dependencies
34 + run: |
35 + npm run build
36 + npm audit --omit=dev --audit-level=high
37 + - id: ready
38 + shell: bash
39 + run: echo "release_tag=${{ inputs.release_tag }}" >> "$GITHUB_OUTPUT"
40 +
41 + windows-public-release:
42 + needs: release-gate
43 + runs-on: windows-latest
44 + timeout-minutes: 60
45 + steps:
46 + - uses: actions/checkout@v4
47 + with:
48 + persist-credentials: false
49 + - uses: actions/setup-node@v4
50 + with:
51 + node-version: '22'
52 + cache: npm
53 + - uses: dtolnay/rust-toolchain@stable
54 + - run: npm ci
55 + - name: Repeat acceptance gate on immutable Windows build source
56 + shell: pwsh
57 + run: node scripts/verify-phase-a-release.mjs "${{ inputs.release_tag }}"
58 + - name: Run Windows integration tests
59 + run: npm test
60 + - name: Build production x64 NSIS installer
61 + run: npm exec tauri build
62 + - name: Verify produced installer and SHA-256 checksum
63 + shell: pwsh
64 + run: |
65 + $version = "${{ inputs.release_tag }}".TrimStart('v')
66 + $files = @(Get-ChildItem 'src-tauri/target/release/bundle/nsis/*x64-setup.exe' -ErrorAction SilentlyContinue)
67 + if ($files.Count -ne 1) { throw 'Exactly one x64 NSIS installer must exist' }
68 + $installer = $files[0]
69 + if (!$installer.Name.Contains($version)) { throw 'Installer version does not match release tag' }
70 + if ($installer.Length -lt 100000) { throw 'Suspiciously small Windows installer' }
71 + $checksum = (Get-FileHash $installer.FullName -Algorithm SHA256).Hash
72 + ($checksum + ' ' + $installer.Name) | Out-File -FilePath SHA256SUMS.txt -Encoding ascii
73 + Write-Output ('INSTALLER=' + $installer.Name + ' SHA256=' + $checksum)
74 + - name: Publish verified version to public GitHub Releases
75 + shell: pwsh
76 + env:
77 + GH_TOKEN: ${{ github.token }}
78 + run: |
79 + $tag = "${{ inputs.release_tag }}"
80 + gh release view $tag --json id *> $null
81 + if ($LASTEXITCODE -eq 0) { throw 'Release already exists; refusing to overwrite it' }
82 + $installer = @(Get-ChildItem 'src-tauri/target/release/bundle/nsis/*x64-setup.exe')[0]
83 + gh release create $tag $installer.FullName SHA256SUMS.txt --target $env:GITHUB_SHA --draft --title "Factor-easyPro $tag — Reliable Accounting Core" --notes-file docs/PHASE_A_RELEASE_NOTES_FA.md
84 + if ($LASTEXITCODE -ne 0) { throw 'Draft release creation failed' }
85 + gh release view $tag --json assets | Out-String | Select-String 'SHA256SUMS.txt' | Out-Null
86 + if ($LASTEXITCODE -ne 0) { throw 'Checksum asset not found' }
87 + gh release edit $tag --draft=false --latest
88 + if ($LASTEXITCODE -ne 0) { throw 'Public release publication failed; verify GitHub state' }
89 + gh release view $tag --json url,isDraft,assets