Skip to content

Commit 500c406

Browse files
committed
[BUILD] Initial signing support with cosign
1 parent 1c01770 commit 500c406

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

.github/workflows/publish-packages-1.0.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,35 @@ jobs:
3939
- name: Setup dotnet
4040
uses: actions/setup-dotnet@v4
4141

42+
- name: Install Cosign
43+
uses: sigstore/cosign/[email protected]
44+
with:
45+
cosign-release: v2.4.0
46+
4247
- name: dotnet restore
4348
run: dotnet restore ./build/OpenTelemetry.proj -p:RunningDotNetPack=true
4449

4550
- name: dotnet build
4651
run: dotnet build ./build/OpenTelemetry.proj --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }} -p:RunningDotNetPack=true
4752

53+
- name: Sign DLLs with Cosign Keyless
54+
run: |
55+
# Define an array of paths for signing.
56+
$dllPaths = @(
57+
'.\src\OpenTelemetry.Api\bin\Release\**\OpenTelemetry.Api.dll'
58+
'.\src\OpenTelemetry\bin\Release\**\OpenTelemetry.dll'
59+
'.\src\OpenTelemetry.Api.ProviderBuilderExtensions\bin\Release\**\OpenTelemetry.Api.ProviderBuilderExtensions.dll'
60+
)
61+
62+
foreach ($path in $dllPaths) {
63+
Write-Host "Processing path: $path"
64+
Get-ChildItem -Path $path -Recurse -File | ForEach-Object {
65+
$fileFullPath = $_.FullName
66+
Write-Host "Signing $fileFullPath"
67+
cosign.exe sign-blob $fileFullPath --yes --output-signature $fileFullPath-keyless.sig --output-certificates $fileFullPath-keyless.pem
68+
}
69+
}
70+
4871
- name: dotnet pack
4972
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release --no-restore --no-build -p:PackTag=${{ github.ref_type == 'tag' && github.ref_name || '' }}
5073

0 commit comments

Comments
 (0)