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

chore: Add code signing certificate hash to secrets and decode it for use #675

Merged
merged 3 commits into from
Mar 24, 2023
Merged
Show file tree
Hide file tree
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
Binary file removed .github/nuget/TwilioCLISigningCertificate.pfx
Binary file not shown.
29 changes: 26 additions & 3 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,40 @@ jobs:
run: |
dotnet tool install --global dotnet-sonarscanner
make cover


import-certificate:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- run: make install
- name: import-certificate
run: |
New-Item -ItemType directory -Path certificate
Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CODE_SIGNING_CERTIFICATE }}'
certutil -decode certificate\certificate.txt certificate\certificate.pfx

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: certificate.pfx
path: certificate\certificate.pfx
retention-days: 1

deploy:
name: Deploy
if: success() && github.ref_type == 'tag'
needs: [ test ]
needs: [ test, import-certificate ]
runs-on: ubuntu-latest
steps:
- name: Checkout twilio-csharp
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Download code signing certificate
uses: actions/download-artifact@v3
with:
name: certificate.pfx

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v3
Expand Down Expand Up @@ -82,7 +105,7 @@ jobs:
- name: Publish package to NuGet
run: |
make release
dotnet nuget sign **/*.nupkg --certificate-path .github/nuget/TwilioCLISigningCertificate.pfx --certificate-password ${{ secrets.CERTIFICATE_PASSWORD }} --timestamper http://timestamp.digicert.com
dotnet nuget sign **/*.nupkg --certificate-path certificate.pfx --certificate-password ${{ secrets.CERTIFICATE_PASSWORD }} --timestamper http://timestamp.digicert.com
dotnet nuget push **/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json

- name: Submit metric to Datadog
Expand Down