@@ -2,6 +2,23 @@ name: Build Windows
2
2
3
3
on :
4
4
workflow_dispatch :
5
+ inputs :
6
+ package_installer :
7
+ description : ' Package Installer'
8
+ required : true
9
+ default : ' true'
10
+ type : choice
11
+ options :
12
+ - ' true'
13
+ - ' false'
14
+ sign_artifact :
15
+ description : ' Sign Artifact'
16
+ required : true
17
+ default : ' true'
18
+ type : choice
19
+ options :
20
+ - ' true'
21
+ - ' false'
5
22
6
23
jobs :
7
24
build-windows :
@@ -26,31 +43,67 @@ jobs:
26
43
27
44
- name : Build with Nuitka
28
45
run : |
29
- python -c "from app.common.config import VERSION; f = open('version.txt', 'w'); f.write(VERSION); f.close()"
46
+ python -c "from app.common.config import VERSION; f = open('version.txt', 'w'); f.write(VERSION); f.close(); f = open('Ghost-Downloader-3.iss', 'r+'); _ = f.read().replace('APPLICATION_VERSION', VERSION); f.seek(0); f.write(_); f.truncate(); f.close(); "
30
47
$VERSION = gc version.txt
31
48
Write-Host "VERSION=$VERSION"
32
49
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
33
50
del version.txt
34
51
python deploy.py
35
52
53
+ - name : Prepare For Sign
54
+ if : ${{ github.event.inputs.sign_artifact == 'true' }}
55
+ run : |
56
+ mv dist/Ghost-Downloader-3.dist dist/Ghost-Downloader-3-Unsigned.dist
57
+
58
+ - name : upload-unsigned-artifact
59
+ if : ${{ github.event.inputs.sign_artifact == 'true' }}
60
+ id : upload-unsigned-artifact
61
+ uses : actions/upload-artifact@v4
62
+ with :
63
+ name : Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}-Unsigned
64
+ path : dist/Ghost-Downloader-3-Unsigned.dist
65
+
66
+ - name : Sign
67
+ if : ${{ github.event.inputs.sign_artifact == 'true' }}
68
+
69
+ with :
70
+ api-token : ' ${{ secrets.SIGNPATH_API_TOKEN }}'
71
+ organization-id : ' ${{ secrets.SIGNPATH_ORGANIZATION_ID }}'
72
+ project-slug : ' Ghost-Downloader-3'
73
+ signing-policy-slug : ' release-signing'
74
+ github-artifact-id : ' ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}'
75
+ wait-for-completion : true
76
+ output-artifact-directory : ' dist/Ghost-Downloader-3.dist'
77
+
36
78
- name : Download Inno Setup Translation Files
79
+ if : ${{ github.event.inputs.package_installer == 'true' }}
37
80
run : |
38
81
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseSimplified.isl" -OutFile "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseSimplified.isl"
39
82
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/jrsoftware/issrc/main/Files/Languages/Unofficial/ChineseTraditional.isl" -OutFile "C:\Program Files (x86)\Inno Setup 6\Languages\ChineseTraditional.isl"
40
83
41
84
- name : Build Installer
85
+ if : ${{ github.event.inputs.package_installer == 'true' }}
42
86
uses :
Minionguyjpro/[email protected]
43
87
with :
44
88
path : Ghost-Downloader-3.iss
45
89
90
+ - name : Rename Installer
91
+ if : ${{ github.event.inputs.package_installer == 'true' }}
92
+ shell : pwsh
93
+ run : |
94
+ mv dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-Setup.exe dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}-Setup.exe
95
+
46
96
- name : Upload Installer
97
+ if : ${{ github.event.inputs.package_installer == 'true' }}
47
98
uses : actions/upload-artifact@v4
48
99
with :
49
100
name : Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}-Setup
50
- path : dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-Setup.exe
101
+ path : dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}- Setup.exe
51
102
52
103
- name : Upload artifacts
53
104
uses : actions/upload-artifact@v4
54
105
with :
55
106
name : Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}
56
- path : dist/Ghost-Downloader-3.dist
107
+ path : |
108
+ dist/Ghost-Downloader-3.dist
109
+
0 commit comments