99 branch :
1010 description : ' Checkout branch'
1111 required : false
12+ default : dev
1213 tag :
1314 description : ' Checkout tag'
1415 required : false
16+ signing :
17+ description : ' Sign executable and installer'
18+ type : boolean
19+ default : false
20+
21+ permissions :
22+ contents : write
1523
1624env :
1725 QT_VERSION : 5.15.2
2230 ARCH : x86
2331 BUILD_TYPE : Release
2432
33+ # SingPath variables
34+ PROJECT_SLUG : OpenModScan
35+ ORGANIZAITION_ID : 2bd9d721-94a7-4c7d-aab8-b81dd84670a5
36+ ARTIFACT_CONF_SLUG : exe-zip
37+
2538jobs :
2639 build-omodscan :
2740 name : Build OpenModScan installer version '${{ github.event.inputs.tag || github.event.inputs.branch || github.ref_name }}' with Qt5 on Windows x86
4659 )
4760 shell : cmd
4861
62+ - name : Select signing policy
63+ run : |
64+ set SIGNING_POLICY_SLUG=none
65+ if "${{ github.event_name }}"=="push" (
66+ if "${{ github.ref_type }}"=="tag" (
67+ set SIGNING_POLICY_SLUG=release-signing
68+ )
69+ )
70+ if "${{ github.event_name }}"=="workflow_dispatch" (
71+ if "${{ github.event.inputs.signing }}"=="true" (
72+ if not "${{ github.event.inputs.tag }}"=="" (
73+ set SIGNING_POLICY_SLUG=release-signing
74+ ) else (
75+ set SIGNING_POLICY_SLUG=test-signing
76+ )
77+ )
78+ )
79+ echo SIGNING_POLICY_SLUG=%SIGNING_POLICY_SLUG%>>%GITHUB_ENV%
80+ echo Selected signing policy: %SIGNING_POLICY_SLUG%
81+ shell : cmd
82+
4983 - name : Install Python (for aqtinstall)
5084 uses : actions/setup-python@v5
5185 with :
@@ -70,6 +104,13 @@ jobs:
70104 with :
71105 vs-version : ' 16.11'
72106
107+ - name : Get Visual Studio path
108+ run : |
109+ for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ^
110+ -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set VS_PATH=%%i
111+ echo VS_PATH=%VS_PATH%>>%GITHUB_ENV%
112+ shell : cmd
113+
73114 - name : Configure CMake
74115 run : |
75116 cmake omodscan -B ${{ env.BUILD_DIR }} -G "${{ env.CMAKE_GENERATOR }}" -A ${{ env.CMAKE_ARCH }} -T v142 -DCMAKE_PREFIX_PATH="C:/Qt/${{ env.QT_VERSION }}/${{ env.CMAKE_COMPILER }}"
@@ -80,12 +121,34 @@ jobs:
80121 cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }} --parallel
81122 shell : cmd
82123
83- - name : Get Visual Studio path
84- run : |
85- for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" ^
86- -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do set VS_PATH=%%i
87- echo VS_PATH=%VS_PATH%>>%GITHUB_ENV%
88- shell : cmd
124+ - name : Upload Executable
125+ id : upload-exe
126+ uses : actions/upload-artifact@v4
127+ if : success()
128+ with :
129+ name : omodscan.exe
130+ path : ${{ env.BUILD_DIR }}\${{ env.BUILD_TYPE }}\omodscan.exe
131+
132+ - name : Signing Executable
133+ uses : signpath/github-action-submit-signing-request@v1
134+ if : success() && env.SIGNING_POLICY_SLUG != 'none'
135+ with :
136+ api-token : ' ${{ secrets.SIGNPATH_API_TOKEN }}'
137+ organization-id : ' ${{ env.ORGANIZAITION_ID }}'
138+ project-slug : ' ${{ env.PROJECT_SLUG }}'
139+ signing-policy-slug : ${{ env.SIGNING_POLICY_SLUG }}
140+ artifact-configuration-slug : ${{ env.ARTIFACT_CONF_SLUG }}
141+ github-artifact-id : ' ${{steps.upload-exe.outputs.artifact-id}}'
142+ output-artifact-directory : ${{ env.BUILD_DIR }}\${{ env.BUILD_TYPE }}
143+ wait-for-completion : true
144+ wait-for-completion-timeout-in-seconds : 3600
145+
146+ - name : Upload signed Executable
147+ uses : actions/upload-artifact@v4
148+ if : success() && env.SIGNING_POLICY_SLUG != 'none'
149+ with :
150+ name : omodscan-signed.exe
151+ path : ${{ env.BUILD_DIR }}\${{ env.BUILD_TYPE }}\omodscan.exe
89152
90153 - name : Deploy Qt dependencies using windeployqt
91154 run : |
@@ -115,8 +178,42 @@ jobs:
115178 shell : cmd
116179
117180 - name : Upload Installer
181+ id : upload-installer
118182 uses : actions/upload-artifact@v4
119183 if : success()
120184 with :
121185 name : qt5-omodscan-${{ env.APP_VERSION }}_${{ env.ARCH }}
122- path : qt5-omodscan-${{ env.APP_VERSION }}_${{ env.ARCH }}.exe
186+ path : qt5-omodscan-${{ env.APP_VERSION }}_${{ env.ARCH }}.exe
187+
188+ - name : Signing Installer
189+ uses : signpath/github-action-submit-signing-request@v1
190+ if : success() && env.SIGNING_POLICY_SLUG != 'none'
191+ with :
192+ api-token : ' ${{ secrets.SIGNPATH_API_TOKEN }}'
193+ organization-id : ' ${{ env.ORGANIZAITION_ID }}'
194+ project-slug : ' ${{ env.PROJECT_SLUG }}'
195+ signing-policy-slug : ${{ env.SIGNING_POLICY_SLUG }}
196+ artifact-configuration-slug : ${{ env.ARTIFACT_CONF_SLUG }}
197+ github-artifact-id : ' ${{steps.upload-installer.outputs.artifact-id}}'
198+ output-artifact-directory : .
199+ wait-for-completion : true
200+ wait-for-completion-timeout-in-seconds : 3600
201+
202+ - name : Upload signed Installer
203+ uses : actions/upload-artifact@v4
204+ if : success() && env.SIGNING_POLICY_SLUG != 'none'
205+ with :
206+ name : qt5-omodscan-${{ env.APP_VERSION }}_${{ env.ARCH }}-signed
207+ path : qt5-omodscan-${{ env.APP_VERSION }}_${{ env.ARCH }}.exe
208+
209+ - name : Create or update GitHub Release and upload EXE
210+ if : success() && github.event_name == 'push' && github.ref_type == 'tag'
211+ uses : softprops/action-gh-release@v2
212+ with :
213+ draft : true
214+ tag_name : ${{ github.ref_name }}
215+ name : Open ModScan ${{ env.APP_VERSION }}
216+ files : |
217+ qt5-omodscan-${{ env.APP_VERSION }}_${{ env.ARCH }}.exe
218+ env :
219+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments