Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
371ad80
Add HSM signing with certificate thumbprint and dispatch to test from…
andrea3bianchi Nov 3, 2025
23ec67b
run the signing on PR
andrea3bianchi Nov 3, 2025
92e3fea
add maxcpucount for windows builder race condition
andrea3bianchi Nov 3, 2025
21a4fdf
auth first, use v3 action
andrea3bianchi Nov 3, 2025
f6a78be
download and install kms cng provider
andrea3bianchi Nov 4, 2025
b46a082
add signtool to path
andrea3bianchi Nov 4, 2025
906d8c5
debug available keys from the chain
andrea3bianchi Nov 4, 2025
02af67d
use full path when instaling kms provider
andrea3bianchi Nov 4, 2025
624f4b8
try using a different working dir
andrea3bianchi Nov 4, 2025
ab88019
use correct directory
andrea3bianchi Nov 4, 2025
93eea44
try dumping some gcloud perms data
andrea3bianchi Nov 4, 2025
541e173
set up gcloud sdk
andrea3bianchi Nov 4, 2025
37c9d06
add cert pub key to windows keystore
andrea3bianchi Nov 4, 2025
7f89972
use the public key out of the kms keychain itself, should make it les…
andrea3bianchi Nov 4, 2025
e21dd5c
fix up location
andrea3bianchi Nov 4, 2025
ace5d49
use committed cert
andrea3bianchi Nov 4, 2025
7e90130
try new signtool incantation
andrea3bianchi Nov 4, 2025
70abbab
use full patj for cert
andrea3bianchi Nov 4, 2025
15ed340
fix path again
andrea3bianchi Nov 4, 2025
7007698
try using nuget sign instead as signtool does not seem to work for nu…
andrea3bianchi Nov 4, 2025
8585d34
try manually loading key from cng provider into store
andrea3bianchi Nov 4, 2025
7a66013
back to the ubuntu runner, try jsign
andrea3bianchi Nov 4, 2025
55b6735
fix jar path
andrea3bianchi Nov 4, 2025
740739a
fix jar path again
andrea3bianchi Nov 4, 2025
a4490d5
remove on branch
andrea3bianchi Nov 4, 2025
bfa3280
update codeowners
andrea3bianchi Nov 4, 2025
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: 44 additions & 0 deletions .github/signing_cert.cer
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
-----BEGIN CERTIFICATE-----
MIIHWTCCBUGgAwIBAgIQCpHMILHwf3nyTsiLiesqxzANBgkqhkiG9w0BAQsFADBp
MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xQTA/BgNVBAMT
OERpZ2lDZXJ0IFRydXN0ZWQgRzQgQ29kZSBTaWduaW5nIFJTQTQwOTYgU0hBMzg0
IDIwMjEgQ0ExMB4XDTI1MTAxNzAwMDAwMFoXDTI4MTAxNjIzNTk1OVowYTELMAkG
A1UEBhMCR0IxDzANBgNVBAcTBkxvbmRvbjEZMBcGA1UEChMQUGF5bWVudHNlbnNl
IEx0ZDELMAkGA1UECxMCSVQxGTAXBgNVBAMTEFBheW1lbnRzZW5zZSBMdGQwggIi
MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwt8TRu8c3YXVLlNdwEjjyyUGF
moknHdaBVrjqnclx1jioJLvcqkdRZZWn/gMF8wxfIng3guPy84O+R6BNqryB+osP
D2Q6m6Ns1nDjgKRRb9GtnBYH3CnPOgCMbrno52TSWIRbFh30aYyCcyq6nfwtOufG
4a/zBz1xyR+VBabOT2pZailIHnbPhy49Kr1gXhE0szzc0lUIcYb5emTSp9TXVma3
5PXJ7WEPddFm8qr03JzmcDIE0GBlTQK67UD7wFq9l1iaF7n/ryvauA17QCDwSSwA
ov7LwMuU57iAHjEDw8aLggiR0xZf850QVMHPxnPWbgrmBNGXMhNO1Q/6j3g8j7ly
YSRxguAVL/zrmziJYLKNKeiLPOpP+5IBTQeoFlq9+GIXctxfuOTbahzzHr/aFeHd
BVhIKj7V5Jo98GjJ8FUX0MbmkTJicI7Bl65eLrxKFwODUtEA74FtDCAC2rUhOnXi
YXq8cp3+LLnJxF+bNRjgnOxcdqD3otZl7cGbnBcvbjEdguk4qdCOpRNRErSQmqjr
Cr1JOqeVdIAeexH27UhKkdSg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ka+1OJ9H4xdMzy1zlEMkgkOXqLxvz1rR9PK
JpmMPVrmhaEhNiEwE0Wx+b8eXREd1N3yGEafdMwR7rIcvWT68y7cLgJx9iVS+znh
MnL1n/qTHxmeqcffiiJh7ybg9q+uwCEkThnQaikZMF7sHkJ5Eui8SRd2AK8HmkXp
bBPuLSvp24Upd6AErO5aMAkc8/wsWUNkSEzm0JhH+Ui4vYtztzRkCVHHZrw5dU+K
fJ2gIi3LwXwE+6CU3dA20fZc4RvEE+VwQ8zLs2c1rA3Qv2x/gexaSJdrVZGTEEvW
SLB/XsGYbIj5zyDZo33Iet5o6wfQWMGirDF7vKlqwafpBErLipDj805h7GGMx7pb
qVSKomSbUDZGaqQxNJ6xoyI38FHaZQ3RpkDvqXegbQRQwKcBhjuXfFGi5cdak6f9
o6ysjcG01v1rJ/krQRw4Wsbfhi5FVWldAuonMrjdTgdJSQZ0exb45WS3/UuDmbDA
NpO1t9/kEbBOBnIrKw==
-----END CERTIFICATE-----


80 changes: 63 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ jobs:
BUILD_CONFIG: 'Release'
PROJECT: 'Dojo.Net.csproj'

runs-on: ubuntu-latest

permissions:
contents: 'read'
id-token: 'write'

defaults:
run:
working-directory: ./src

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Expand All @@ -27,24 +31,66 @@ jobs:
- name: Restore dependencies
run: dotnet restore

- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WIF_PROVIDER }}

- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v3

- name: Download Jsign
working-directory: ${{ github.workspace }}
run: |
version="7.4"
downloadUrl="https://github.com/ebourg/jsign/releases/download/$version/jsign-$version.jar"

echo "Downloading Jsign v$version from $downloadUrl"
wget -q $downloadUrl -O jsign.jar

echo "Jsign downloaded successfully"

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration $BUILD_CONFIG -p:Version=${{ github.event.release.tag_name }} --no-restore
run: dotnet build --configuration $BUILD_CONFIG -p:Version=${{ github.event.release.tag_name || '0.0.1-test' }} --no-restore

- name: Run tests
run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal


# RELEASE UNSIGNED FOR NOW, new signing cert in a gcp wallet is being issued,
# waiting to get workload identity federation for this repo to be set up
# - name: Export certificate
# id: write_file
# uses: timheuer/base64-to-file@v1.1
# with:
# fileName: 'sign.cer'
# encodedString: ${{ secrets.NUGET_SIGNING_CERT }}

# - name: Sign
# run: dotnet nuget sign **\*.nupkg --certificate-path ${{ steps.write_file.outputs.filePath }} --certificate-password ${{ secrets.NUGET_SIGNING_CERT_PASSWORD }} --timestamper http://timestamp.digicert.com

- name: Sign NuGet packages
run: |
certPath="${{ github.workspace }}/.github/signing_cert.cer"
jsignJar="${{ github.workspace }}/jsign.jar"
kmsKeyPath="projects/${{ secrets.GCP_PROJECT_ID }}/locations/europe-west2/keyRings/EVCodeSigningKeyRing/cryptoKeys/EVCodeSignDojo/cryptoKeyVersions/1"
accessToken=$(gcloud auth print-access-token)

echo "Signing NuGet packages with Jsign + Google Cloud KMS"

# Find all .nupkg files (excluding symbols packages)
find . -name "*.nupkg" ! -name "*.symbols.nupkg" | while read package; do
echo "Signing $package"

java -jar "$jsignJar" \
--storetype GOOGLECLOUD \
--keystore "projects/${{ secrets.GCP_PROJECT_ID }}/locations/europe-west2/keyRings/EVCodeSigningKeyRing" \
--storepass "$accessToken" \
--alias "EVCodeSignDojo/cryptoKeyVersions/1" \
--certfile "$certPath" \
--tsaurl "http://timestamp.digicert.com" \
--tsmode RFC3161 \
"$package"

if [ $? -ne 0 ]; then
echo "Failed to sign package: $package"
exit 1
fi
done

echo "All packages signed successfully"

- name: Publish
run: dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}}
if: ${{ github.event_name == 'release' }}
run: dotnet nuget push '**/*.nupkg' --source 'https://api.nuget.org/v3/index.json' --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @Dojo-Engineering/remote-payments
* @Dojo-Engineering/core_payments-integration_platform
Loading