Skip to content

Commit

Permalink
#45 Sign DR2 executable as well
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbechtold committed Jul 19, 2020
1 parent 59d8aaa commit d5c0d8f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ jobs:

- name: Bundle DR2 executable / PyInstaller
run: |
resources\bundle-dr2.bat
resources\bundle-dr2.ps1
shell: pwsh
env:
DRTR_CODESIGN_CERTIFICATE_PASS: ${{ secrets.DRTR_CODESIGN_CERTIFICATE_PASS }}

- name: Zip distribution / create-7z-action
uses: DuckSoft/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions docs/develop.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ To bundle for DiRT Rally
To bundle for DiRT Rally 2.0
* Cf. job `assemble`, step `Bundle DR2` in `.github/workflows/main.yml`

Hint: To invoke the .ps1 scripts, you need the Powershell Core (6 or newer) and to [allow script execution](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7). You should also remove the signing step
in the scripts if you bundle locally.

# Releasing

## Requirements
Expand Down
5 changes: 0 additions & 5 deletions resources/bundle-dr1.bat

This file was deleted.

2 changes: 1 addition & 1 deletion resources/bundle-dr1.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ if (Test-Path dirtrally-lb.db) {
bin\sqlite3 -batch -init resources\setup-dr1.sql dirtrally-lb.db .exit
pyinstaller timerecord.spec --noconfirm --name timerecorder-dr1
pwsh.exe -wd resources resources\sign.ps1 -Exe ..\dist\timerecorder-dr1\timerecord.exe
exit $LASTEXITCODE
exit $LASTEXITCODE
3 changes: 0 additions & 3 deletions resources/bundle-dr2.bat

This file was deleted.

7 changes: 7 additions & 0 deletions resources/bundle-dr2.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (Test-Path dirtrally-lb.db) {
Remove-Item -Force dirtrally-lb.db
}
bin\sqlite3 -batch -init resources\setup-dr2.sql dirtrally-lb.db .exit
pyinstaller timerecord.spec --noconfirm --name timerecorder-dr2
pwsh.exe -wd resources resources\sign.ps1 -Exe ..\dist\timerecorder-dr2\timerecord.exe
exit $LASTEXITCODE
2 changes: 0 additions & 2 deletions resources/sign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ param ($Exe = $(throw "Exe parameter is required."))
# (Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert)[0] | Export-PfxCertificate -FilePath code_signing.pfx -Password $mypwd
## or unprotected, or use certmgr.msc
# Export-Certificate -Cert (Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert)[0] -FilePath code_signing.crt
## Short circuit locally
# $env:DRTR_CODESIGN_CERTIFICATE_PASS = ConvertFrom-SecureString -SecureString $mypwd

## Apply it in CI (PWSH 6+)
try {
Expand Down

0 comments on commit d5c0d8f

Please sign in to comment.