Skip to content

Commit 469ddb5

Browse files
committed
Add PS Arguments
1 parent 369b8fc commit 469ddb5

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

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

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ 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"
4347
- name: Set up Python ${{ matrix.python-version }}
4448
uses: actions/setup-python@v4
4549
with:
@@ -84,25 +88,10 @@ jobs:
8488
run: |
8589
$version_raw = Get-Content ./version.txt -Raw
8690
$version = $version_raw -replace "`n","" -replace "`r",""
87-
$unsigned_filename = "unsigned_${version}_windows_amd64.exe"
91+
$unsigned_filename = "scsd-gui_${version}_windows_amd64.exe"
8892
.\scripts\build\windows\set_version_from_template.ps1
8993
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
9094
91-
- name: Sign (Windows)
92-
if: ${{ matrix.os == 'windows-latest' }}
93-
run: |
94-
.\scripts\build\windows\signtool.ps1
95-
96-
# Rename because signing proecdure will collide filename & certname
97-
- name: Rename (Windows)
98-
if: ${{ matrix.os == 'windows-latest' }}
99-
run: |
100-
$version_raw = Get-Content ./version.txt -Raw
101-
$version = $version_raw -replace "`n","" -replace "`r",""
102-
$unsigned_filename = "unsigned_${version}_windows_amd64.exe"
103-
$signed_filename = "scsd-gui_${version}_windows_amd64.exe"
104-
Move-Item $unsigned_filename $signed_filename
105-
10695
- name: Build
10796
if: ${{ matrix.os == 'ubuntu-latest' }}
10897
run: |

scripts/build/windows/signtool.ps1

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
1+
param (
2+
#'${{ secrets.SIGNTOOL_CERT }}'
3+
[Parameter(Mandatory=$true)]
4+
[String]$cert_base64,
5+
6+
#'${{ secrets.SIGNTOOL_PASS }}'
7+
[Parameter(Mandatory=$true)]
8+
[String]$cert_passwd,
9+
10+
#'${{ secrets.SIGNTOOL_FINGERPRINT }}'
11+
[Parameter(Mandatory=$true)]
12+
[String]$cert_fingerprint,
13+
14+
#'${{ secrets.SIGNTOOL_NAME }}'
15+
[Parameter(Mandatory=$true)]
16+
[String]$cert_name,
17+
18+
[Parameter(Mandatory=$true)]
19+
[String]$target
20+
)
21+
122
# Find signtool
223

3-
$dir = dir "C:/Program Files (x86)/Windows Kits/10/bin/" | ?{$_.PSISContainer}
24+
$dir = Get-ChildItem "C:/Program Files (x86)/Windows Kits/10/bin/" | Where-Object{$_.PSISContainer}
425

526
$newest_version = 0
627
$newest_version_path = ""
728
foreach ($d in $dir) {
8-
if (-Not ($d.EndsWith('.0'))) {
29+
if (-Not ($d.FullName.EndsWith('.0'))) {
930
Write-Host "Skip $($d)"
1031
continue
1132
}
1233

13-
if (-Not (Test-Path "$($d)\x64\signtool.exe" -PathType Leaf)) {
34+
if (-Not (Test-Path "$($d.FullName)\x64\signtool.exe" -PathType Leaf)) {
1435
Write-Host "[no exe] Skip $($d)"
1536
continue
1637
}
1738

18-
$leaf = $d.split("\")[-1]
39+
$leaf = $d.FullName.split("\")[-1]
1940
Write-Host "Leaf: $leaf"
2041

2142
$version = $leaf -replace ".","" -as [int]
@@ -30,11 +51,3 @@ $signtool = "$($newest_version_path)\x64\signtool.exe"
3051

3152
Write-Host "Signtool: $($signtool)"
3253

33-
#certificate: '${{ secrets.SIGNTOOL_CERT }}'
34-
#password: '${{ secrets.SIGNTOOL_PASS }}'
35-
#certificatesha1: '${{ secrets.SIGNTOOL_FINGERPRINT }}'
36-
#certificatename: '${{ secrets.SIGNTOOL_NAME }}'
37-
#description: 'scsd-gui'
38-
#timestampUrl: 'http://timestamp.digicert.com'
39-
#folder: 'dist'
40-
#recursive: true

0 commit comments

Comments
 (0)