Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use published sign.exe CLI and 3rd part certificate extractor tools #1647

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 19 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -349,24 +349,16 @@ jobs:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Download/extract Sign CLI tool
env:
AST: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
ASC: ${{ secrets.AZURE_STORAGE_CONTAINER }}
SCT: 'Sign.Cli-alpha.zip'
- name: Install sign CLI tool
run: |
az storage blob download --file sign-cli.zip --auth-mode login `
--account-name $env:AST --container-name $env:ASC --name $env:SCT
Expand-Archive -Path sign-cli.zip -DestinationPath .\sign-cli
dotnet tool install -g --version 0.9.1-beta.24325.5

- name: Sign payload
run: |
./sign-cli/sign.exe code trusted-signing payload/* `
sign.exe code trusted-signing payload/* `
-tse https://wus2.codesigning.azure.net/ `
-tsa git-fundamentals-signing `
-tscp git-fundamentals-windows-signing `
-d "Git Fundamentals Windows Signing Certificate" `
-u "https://github.com/git-ecosystem/git-credential-manager"
-tscp git-fundamentals-windows-signing

- name: Lay out signed payload, images, and symbols
shell: bash
Expand Down Expand Up @@ -433,28 +425,30 @@ jobs:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Download/extract Sign CLI tool
env:
AST: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
ASC: ${{ secrets.AZURE_STORAGE_CONTAINER }}
SCT: 'Sign.Cli-alpha.zip'
- name: Install sign CLI tool
run: |
az storage blob download --file sign-cli.zip --auth-mode login `
--account-name $env:AST --container-name $env:ASC --name $env:SCT
Expand-Archive -Path sign-cli.zip -DestinationPath .\sign-cli
dotnet tool install -g --version 0.9.1-beta.24325.5

- name: Sign package
run: |
./sign-cli/sign.exe code trusted-signing nupkg/* `
sign.exe code trusted-signing nupkg/* `
-tse https://wus2.codesigning.azure.net/ `
-tsa git-fundamentals-signing `
-tscp git-fundamentals-windows-signing `
-d "Git Fundamentals Windows Signing Certificate" `
-u "https://github.com/git-ecosystem/git-credential-manager" `
-co nuget-signing-certificate.cer
-tscp git-fundamentals-windows-signing

mv nupkg/* .

# Remove this once NuGet supports the subscriber identity validation EKU:
# https://github.com/NuGet/NuGetGallery/issues/10027
- name: Extract signing certificate from package
shell: pwsh
run: |
dotnet tool install --global Knapcode.CertificateExtractor
$nupkg = gci *.nupkg
nuget-cert-extractor --file $nupkg --output certs --code-signing --author --leaf
$cert = gci certs\*.cer
mv $cert .\nuget-signing.cer

- name: Publish signed package and certificate
uses: actions/upload-artifact@v4
with:
Expand Down