Skip to content

Commit 2053809

Browse files
authored
Merge pull request cli#201 from github/cleanup-scripts
Cleanup release scripts
2 parents 1f2277c + 0639ef8 commit 2053809

5 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/go.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
uses: actions/setup-go@v1
1313
with:
1414
go-version: 1.13
15-
id: go
1615

1716
- name: Check out code into the Go module directory
1817
uses: actions/checkout@v1

.github/workflows/releases.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ jobs:
1212
- name: Checkout
1313
uses: actions/checkout@v1
1414
- name: Set up Go 1.13
15-
id: go
1615
uses: actions/setup-go@v1
1716
with:
1817
go-version: 1.13
@@ -34,7 +33,6 @@ jobs:
3433
- name: Checkout
3534
uses: actions/checkout@v1
3635
- name: Set up Go 1.13
37-
id: go
3836
uses: actions/setup-go@v1
3937
with:
4038
go-version: 1.13
@@ -51,14 +49,16 @@ jobs:
5149
with:
5250
exe: ${{ steps.download_exe.outputs.exe }}
5351
- name: Obtain signing cert
52+
id: obtain_cert
5453
env:
5554
DESKTOP_CERT_TOKEN: ${{ secrets.DESKTOP_CERT_TOKEN }}
56-
run: .\setup-windows-certificate.ps1
57-
shell: powershell
55+
run: .\script\setup-windows-certificate.ps1
5856
- name: Sign MSI
5957
env:
6058
GITHUB_CERT_PASSWORD: ${{ secrets.GITHUB_CERT_PASSWORD }}
61-
run: .\sign.ps1 -Certificate "windows-certificate.pfx" -Executable "${{ steps.buildmsi.outputs.msi }}"
59+
run: |
60+
.\script\sign.ps1 -Certificate "${{ steps.obtain_cert.outputs.cert-file }}" `
61+
-Executable "${{ steps.buildmsi.outputs.msi }}"
6262
- name: Upload MSI
6363
uses: ./.github/actions/upload-msi
6464
env:
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
2+
$certFile = "$scriptPath\windows-certificate.pfx"
23

34
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
45
$headers.Add("Authorization", "token $env:DESKTOP_CERT_TOKEN")
56
$headers.Add("Accept", 'application/vnd.github.v3.raw')
67

78
Invoke-WebRequest 'https://api.github.com/repos/desktop/desktop-secrets/contents/windows-certificate.pfx' `
89
-Headers $headers `
9-
-OutFile "$scriptPath\windows-certificate.pfx"
10+
-OutFile "$certFile"
11+
12+
Write-Output "::set-output name=cert-file::$certFile"

sign.ps1 renamed to script/sign.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ $thumbprint = "fb713a60a7fa79dfc03cb301ca05d4e8c1bdd431"
1010
$passwd = $env:GITHUB_CERT_PASSWORD
1111
$ProgramName = "GitHub CLI"
1212

13-
& .\signtool.exe sign /d $ProgramName /f $Certificate /p $passwd /sha1 $thumbprint /fd sha256 /tr http://timestamp.digicert.com /td sha256 /v $Executable
13+
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
14+
15+
& $scriptPath\signtool.exe sign /d $ProgramName /f $Certificate /p $passwd `
16+
/sha1 $thumbprint /fd sha256 /tr http://timestamp.digicert.com /td sha256 /v `
17+
$Executable
File renamed without changes.

0 commit comments

Comments
 (0)