Skip to content

Commit f4ca4b4

Browse files
committed
Add Sign Procedure
1 parent a948f88 commit f4ca4b4

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

.github/workflows/check-test-build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ jobs:
4040
with:
4141
fetch-depth: 0
4242
submodules: true
43-
- name: Sign (Windows) # TODO- temporary here
44-
if: ${{ matrix.os == 'windows-latest' }}
45-
run: |
46-
.\scripts\build\windows\signtool.ps1 -cert_base64 '${{ secrets.SIGNTOOL_CERT }}' -cert_passwd '${{ secrets.SIGNTOOL_PASS }}' -cert_fingerprint '${{ secrets.SIGNTOOL_FINGERPRINT }}' -cert_name '${{ secrets.SIGNTOOL_NAME }}' -target "Achaka"
4743
- name: Set up Python ${{ matrix.python-version }}
4844
uses: actions/setup-python@v4
4945
with:
@@ -88,9 +84,18 @@ jobs:
8884
run: |
8985
$version_raw = Get-Content ./version.txt -Raw
9086
$version = $version_raw -replace "`n","" -replace "`r",""
91-
$unsigned_filename = "scsd-gui_${version}_windows_amd64.exe"
87+
$filename = "scsd-gui_${version}_windows_amd64.exe"
9288
.\scripts\build\windows\set_version_from_template.ps1
93-
pyinstaller --version-file "./version_windows.txt" --add-data "version.txt;." --icon "./steamCloudSaveDownloaderGUI/res/scsd_256.ico" --hide-console hide-late --collect-all steamCloudSaveDownloaderGUI --collect-all dateutil --collect-all steamCloudSaveDownloader --onefile ./scsd-gui --name $unsigned_filename
89+
pyinstaller --version-file "./version_windows.txt" --add-data "version.txt;." --icon "./steamCloudSaveDownloaderGUI/res/scsd_256.ico" --hide-console hide-late --collect-all steamCloudSaveDownloaderGUI --collect-all dateutil --collect-all steamCloudSaveDownloader --onefile ./scsd-gui --name $filename
90+
91+
- name: Sign (Windows)
92+
if: ${{ matrix.os == 'windows-latest' }}
93+
run: |
94+
$version_raw = Get-Content ./version.txt -Raw
95+
$version = $version_raw -replace "`n","" -replace "`r",""
96+
$filename = "scsd-gui_${version}_windows_amd64.exe"
97+
98+
.\scripts\build\windows\signtool.ps1 -cert_base64 '${{ secrets.SIGNTOOL_CERT }}' -cert_passwd '${{ secrets.SIGNTOOL_PASS }}' -cert_fingerprint '${{ secrets.SIGNTOOL_FINGERPRINT }}' -cert_name '${{ secrets.SIGNTOOL_NAME }}' -target $filename
9499
95100
- name: Build
96101
if: ${{ matrix.os == 'ubuntu-latest' }}

scripts/build/windows/signtool.ps1

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,9 @@ foreach ($d in $dir) {
3838

3939
$leaf = $d.FullName.split("\")[-1]
4040

41-
$version = $leaf -replace ".",""
42-
Write-Host "Leaf: $($leaf)"
43-
Write-Host "Version: $($version)"
41+
$version = ($leaf -replace "\.","") -as [int]
42+
Write-Host "Leaf: $($leaf) Version: $($version)"
4443

45-
$version = $version -as [int]
46-
Write-Host "Version: $($version)"
47-
48-
Write-Host "CMP: $($version) $($newest_version)"
49-
Write-Host "CMP: $($version.getType()) $($newest_version.getType())"
5044
if ($version -gt $newest_version) {
5145
$newest_version = $version
5246
$newest_version_path = $d.FullName
@@ -65,4 +59,7 @@ $cert_bytes = [Convert]::FromBase64String($cert_base64)
6559

6660
# Import Cert
6761
certutil -f -p $cert_passwd -importpfx $certificate
68-
Set-Location Cert:\CurrentUser\My
62+
Set-Location Cert:\CurrentUser\My
63+
64+
# Sign
65+
$signtool sign /f $certificate /p $cert_passwd /fd SHA256 /tr http://timestamp.digicert.com /td SHA256 $target

0 commit comments

Comments
 (0)