Debian Codegraph @

.github/workflows/build-and-sign-win-installer.yml

raw symbols SCIP
1 name: build-and-sign-win-installer
2
3 on:
4 workflow_dispatch:
5 inputs:
6 portable_run_id:
7 description: 'Run ID of the build-and-sign-win-portable run to pull artifacts from (only needed when triggering manually)'
8 required: false
9 workflow_run:
10 workflows: ["build-and-sign-win-portable"]
11 types: [completed]
12
13 jobs:
14 build-installer:
15 runs-on: windows-latest
16 if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
17
18 steps:
19 # ------------------------------------------------------------------
20 # 1. Checkout source (need installers/Photoflare.aip)
21 # ------------------------------------------------------------------
22 - name: Checkout photoflare
23 uses: actions/checkout@v4
24
25 # ------------------------------------------------------------------
26 # 2. Get the already-signed portable package
27 # (produced by the build-and-sign-win-portable workflow)
28 # ------------------------------------------------------------------
29 - name: Download signed portable package
30 uses: actions/download-artifact@v4
31 with:
32 name: photoflare-portable-signed
33 path: installers\PhotoFlare_Win_AIP
34 github-token: ${{ secrets.GITHUB_TOKEN }}
35 repository: ${{ github.repository }}
36 run-id: ${{ github.event.workflow_run.id || inputs.portable_run_id }}
37
38 # ------------------------------------------------------------------
39 # 3. Read version from stable.json
40 # ------------------------------------------------------------------
41 - name: Read version from stable.json
42 id: version
43 shell: pwsh
44 run: |
45 $raw = Get-Content versions\stable.json -Raw
46 $version = $raw.Trim()
47 $fullVersion = "$version.0"
48 Write-Host "Read version: $version -> using $fullVersion"
49 echo "version=$fullVersion" >> $env:GITHUB_OUTPUT
50
51 # ------------------------------------------------------------------
52 # 4. Build the installer with Advanced Installer
53 # ------------------------------------------------------------------
54 - name: Build installer with Advanced Installer
55 uses: caphyon/advinst-github-action@main
56 with:
57 advinst-version: '23.9'
58 advinst-license: '${{ secrets.ADVINST_LICENSE_KEY }}'
59 advinst-enable-automation: 'true'
60 aip-path: '${{ github.workspace }}\installers\Photoflare.aip'
61 aip-build-name: DefaultBuild
62 aip-output-dir: '${{ github.workspace }}\installer-output'
63 aip-commands: |
64 SetVersion ${{ steps.version.outputs.version }}
65
66 # ------------------------------------------------------------------
67 # 5. Upload the unsigned installer output
68 # ------------------------------------------------------------------
69 - name: Upload unsigned installer
70 id: upload-unsigned-installer
71 uses: actions/upload-artifact@v4
72 with:
73 name: photoflare-installer-unsigned
74 path: installer-output\*.msi
75
76 # ------------------------------------------------------------------
77 # 6. Submit to SignPath and wait for the signed result
78 # ------------------------------------------------------------------
79 - name: Submit installer for signing
80 uses: signpath/github-action-submit-signing-request@v2
81 with:
82 api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
83 organization-id: 'a0d93669-036e-4935-85d0-ad3813a95399'
84 project-slug: 'photoflare'
85 signing-policy-slug: 'test-signing'
86 artifact-configuration-slug: 'github-installer'
87 github-artifact-id: '${{ steps.upload-unsigned-installer.outputs.artifact-id }}'
88 wait-for-completion: true
89 output-artifact-directory: 'installer-signed'
90
91 # ------------------------------------------------------------------
92 # 7. Upload the final signed installer
93 # ------------------------------------------------------------------
94 - name: Upload signed installer
95 uses: actions/upload-artifact@v4
96 with:
97 name: photoflare-installer-signed
98 path: installer-signed\