@@ -2,6 +2,15 @@ name: Build Windows
22
33on :
44 workflow_dispatch :
5+ inputs :
6+ package_installer :
7+ description : ' Package Installer'
8+ required : false
9+ default : ' true'
10+ sign_artifact :
11+ description : ' Sign Artifact'
12+ required : false
13+ default : ' true'
514
615jobs :
716 build-windows :
@@ -26,31 +35,66 @@ jobs:
2635
2736 - name : Build with Nuitka
2837 run : |
29- python -c "from app.common.config import VERSION; f = open('version.txt', 'w'); f.write(VERSION); f.close()"
38+ 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('"{VERSION}"', f'"{VERSION}"'); f.seek(0); f.write(_); f.truncate(); f.close(); "
3039 $VERSION = gc version.txt
3140 Write-Host "VERSION=$VERSION"
3241 echo "VERSION=$VERSION" >> $env:GITHUB_ENV
3342 del version.txt
3443 python deploy.py
3544
45+ - name : Prepare For Sign
46+ if : ${{ github.event.inputs.sign_artifact == 'true' }}
47+ run : |
48+ mv dist/Ghost-Downloader-3.dist dist/Ghost-Downloader-3-Unsigned.dist
49+
50+ - name : upload-unsigned-artifact
51+ if : ${{ github.event.inputs.sign_artifact == 'true' }}
52+ id : upload-unsigned-artifact
53+ uses : actions/upload-artifact@v4
54+ with :
55+ name : Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}-Unsigned
56+ path : dist/Ghost-Downloader-3-Unsigned.dist
57+
58+ - name : Sign
59+ if : ${{ github.event.inputs.sign_artifact == 'true' }}
60+ 61+ with :
62+ api-token : ' ${{ secrets.SIGNPATH_API_TOKEN }}'
63+ organization-id : ' ${{ secrets.SIGNPATH_ORGANIZATION_ID }}'
64+ project-slug : ' Ghost-Downloader-3'
65+ signing-policy-slug : ' release-signing'
66+ github-artifact-id : ' ${{ steps.upload-unsigned-artifact.outputs.artifact-id }}'
67+ wait-for-completion : true
68+ output-artifact-directory : ' dist/Ghost-Downloader-3.dist'
69+
3670 - name : Download Inno Setup Translation Files
71+ if : ${{ github.event.inputs.package_installer == 'true' }}
3772 run : |
3873 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"
3974 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"
4075
4176 - name : Build Installer
77+ if : ${{ github.event.inputs.package_installer == 'true' }}
4278 uses :
Minionguyjpro/[email protected] 4379 with :
4480 path : Ghost-Downloader-3.iss
4581
82+ - name : Rename Installer
83+ if : ${{ github.event.inputs.package_installer == 'true' }}
84+ run : |
85+ mv dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-Setup.exe dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}-Setup.exe
86+
4687 - name : Upload Installer
88+ if : ${{ github.event.inputs.package_installer == 'true' }}
4789 uses : actions/upload-artifact@v4
4890 with :
4991 name : Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}-Setup
50- path : dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-Setup.exe
92+ path : dist/Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}- Setup.exe
5193
5294 - name : Upload artifacts
5395 uses : actions/upload-artifact@v4
5496 with :
5597 name : Ghost-Downloader-v${{ env.VERSION }}-Windows-${{ matrix.architecture }}
56- path : dist/Ghost-Downloader-3.dist
98+ path : |
99+ dist/Ghost-Downloader-3.dist
100+
0 commit comments