-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e83c76
commit 7fd9def
Showing
2 changed files
with
64 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,28 +42,43 @@ runs: | |
run: | | ||
echo winget > ${{ env.BINARY_BUILD_DIR }}\_internal\algokit\resources\distribution-method | ||
- name: Sign executable | ||
uses: azure/[email protected] | ||
with: | ||
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
endpoint: https://weu.codesigning.azure.net/ | ||
trusted-signing-account-name: "Algorand Foundation" | ||
certificate-profile-name: algokit | ||
files-folder: ${{ env.BINARY_BUILD_DIR }} | ||
files-folder-filter: exe | ||
file-digest: SHA256 | ||
timestamp-rfc3161: http://timestamp.acs.microsoft.com | ||
timestamp-digest: SHA256 | ||
|
||
# We only sign the release artifacts, as each signing request will use up the HSM quota | ||
- name: Download signing certificate | ||
if: ${{ inputs.production_release == 'true' }} | ||
run: | | ||
signing_cert="${{ runner.temp }}\code_signing_cert.pfx" | ||
echo "SIGNING_CERT=${signing_cert}" >> $GITHUB_ENV | ||
echo '${{ inputs.code_signing_cert }}' | base64 -d > $signing_cert | ||
shell: bash | ||
# - name: Download signing certificate | ||
# if: ${{ inputs.production_release == 'true' }} | ||
# run: | | ||
# signing_cert="${{ runner.temp }}\code_signing_cert.pfx" | ||
# echo "SIGNING_CERT=${signing_cert}" >> $GITHUB_ENV | ||
# echo '${{ inputs.code_signing_cert }}' | base64 -d > $signing_cert | ||
# shell: bash | ||
|
||
- name: Import signing certificate | ||
if: ${{ inputs.production_release == 'true' }} | ||
shell: pwsh | ||
run: | | ||
Import-PfxCertificate -FilePath ${{ env.SIGNING_CERT }} -Password (ConvertTo-SecureString -String ${{ inputs.code_signing_cert_password }} -AsPlainText -Force) -CertStoreLocation Cert:\CurrentUser\My | Out-Null | ||
# - name: Import signing certificate | ||
# if: ${{ inputs.production_release == 'true' }} | ||
# shell: pwsh | ||
# run: | | ||
# Import-PfxCertificate -FilePath ${{ env.SIGNING_CERT }} -Password (ConvertTo-SecureString -String ${{ inputs.code_signing_cert_password }} -AsPlainText -Force) -CertStoreLocation Cert:\CurrentUser\My | Out-Null | ||
|
||
- name: Sign executable | ||
if: ${{ inputs.production_release == 'true' }} | ||
shell: pwsh | ||
run: | | ||
$executablePath = '${{ env.BINARY_BUILD_DIR }}\algokit.exe' | ||
signtool sign /sha1 ${{ inputs.code_signing_cert_sha1_hash }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 $executablePath | ||
# signtool verify /v /pa $executablePath | ||
# - name: Sign executable | ||
# if: ${{ inputs.production_release == 'true' }} | ||
# shell: pwsh | ||
# run: | | ||
# $executablePath = '${{ env.BINARY_BUILD_DIR }}\algokit.exe' | ||
# signtool sign /sha1 ${{ inputs.code_signing_cert_sha1_hash }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 $executablePath | ||
# # signtool verify /v /pa $executablePath | ||
|
||
- name: Build winget installer | ||
shell: pwsh | ||
|
@@ -74,19 +89,34 @@ runs: | |
-outputFile '${{ env.WINGET_INSTALLER }}' | ||
- name: Sign winget installer | ||
if: ${{ inputs.production_release == 'true' }} | ||
shell: pwsh | ||
run: | | ||
signtool sign /sha1 ${{ inputs.code_signing_cert_sha1_hash }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${{ env.WINGET_INSTALLER }} | ||
# signtool verify /v /pa ${{ env.WINGET_INSTALLER }} | ||
uses: azure/[email protected] | ||
with: | ||
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
endpoint: https://weu.codesigning.azure.net/ | ||
trusted-signing-account-name: "Algorand Foundation" | ||
certificate-profile-name: algokit | ||
files-folder: ${{ env.WINGET_INSTALLER }} | ||
files-folder-filter: msix | ||
file-digest: SHA256 | ||
timestamp-rfc3161: http://timestamp.acs.microsoft.com | ||
timestamp-digest: SHA256 | ||
|
||
- name: Remove signing certificate | ||
if: ${{ inputs.production_release == 'true' }} | ||
shell: pwsh | ||
run: | | ||
$cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq '${{ inputs.code_signing_cert_sha1_hash }}' } | ||
Remove-Item -Path $cert.PSPath | ||
Remove-Item -Path ${{ env.SIGNING_CERT }} | ||
# - name: Sign winget installer | ||
# if: ${{ inputs.production_release == 'true' }} | ||
# shell: pwsh | ||
# run: | | ||
# signtool sign /sha1 ${{ inputs.code_signing_cert_sha1_hash }} /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 ${{ env.WINGET_INSTALLER }} | ||
# # signtool verify /v /pa ${{ env.WINGET_INSTALLER }} | ||
|
||
# - name: Remove signing certificate | ||
# if: ${{ inputs.production_release == 'true' }} | ||
# shell: pwsh | ||
# run: | | ||
# $cert = Get-ChildItem -Path Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq '${{ inputs.code_signing_cert_sha1_hash }}' } | ||
# Remove-Item -Path $cert.PSPath | ||
# Remove-Item -Path ${{ env.SIGNING_CERT }} | ||
|
||
- name: Upload winget artifact | ||
uses: actions/upload-artifact@v4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7fd9def
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage Report