Skip to content

Commit f3faaea

Browse files
committed
initial implementation of macOS crypto backend
2 parents 81e6b29 + dfd8d2d commit f3faaea

22 files changed

+1563
-1389
lines changed

.github/workflows/codeql.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ jobs:
2323
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2424

2525
- name: Initialize CodeQL
26-
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
26+
uses: github/codeql-action/init@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
2727
with:
2828
languages: go
2929

3030
- name: Autobuild
31-
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
31+
uses: github/codeql-action/autobuild@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
3232
with:
3333
working-directory: eng/_util
3434

3535
- name: Perform CodeQL Analysis
36-
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
36+
uses: github/codeql-action/analyze@b6a472f63d85b9c78a3ac5e89422239fc15e9b3c # v3.28.1
3737
with:
3838
category: /language:go

eng/pipeline/stages/builders-to-stages.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ stages:
7070
- template: pool.yml
7171
parameters:
7272
inner:
73-
template: publish-stage.yml
73+
template: internal-publish-stage.yml
7474
parameters:
7575
builder: { os: windows, arch: amd64 }
7676
official: true
77-
public: false
7877
builders:
7978
- ${{ each builder in parameters.builders }}:
8079
- ${{ if eq(builder.config, 'buildandpack') }}:

eng/pipeline/stages/publish-stage.yml eng/pipeline/stages/internal-publish-stage.yml

+65-66
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
# Create a build asset JSON file as a pipeline artifact and publish build artifacts to blob storage.
66

77
parameters:
8-
- name: public
9-
type: boolean
10-
118
- name: pool
129
type: object
1310

@@ -28,34 +25,19 @@ parameters:
2825
default: false
2926

3027
stages:
31-
- stage: Publish${{ parameters.public }}
32-
${{ if parameters.public }}:
33-
displayName: Publish Public
34-
${{ else }}:
35-
displayName: Publish Internal
28+
- stage: PrePublish
29+
displayName: Pre Internal Publish
3630
${{ if eq(parameters.publishExistingRunID, 'nil') }}:
3731
dependsOn: Sign
3832
${{ else }}:
3933
dependsOn: []
34+
4035
jobs:
41-
- job: Publish
36+
- job: PrePublish
4237
pool: ${{ parameters.pool }}
4338

4439
variables:
45-
- name: blobBackupAccount
46-
value: golangartifactsbackup
47-
- name: blobContainer
48-
${{ if parameters.public }}:
49-
value: 'https://dotnetbuildoutput.blob.core.windows.net/golang/microsoft'
50-
${{ else }}:
51-
value: 'https://$(blobBackupAccount).blob.core.windows.net/microsoft'
52-
53-
- name: blobPrefix
54-
value: '$(PublishBranchAlias)/$(Build.BuildNumber)'
55-
- name: blobDestinationUrl
56-
value: '$(blobContainer)/$(blobPrefix)'
57-
58-
- group: go-storage
40+
- template: ../variables/publish-internal.yml
5941

6042
workspace:
6143
clean: all
@@ -68,17 +50,11 @@ stages:
6850
# Single file publish requires folder to be specified.
6951
# https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/sbom#specifying-sbom-build-drop-path-build-component-path-package-name-and-package-version-per-1es-pt-output
7052
sbomBuildDropPath: $(Pipeline.Workspace)/Binaries Signed
71-
${{ if parameters.public }}:
72-
artifact: BuildAssets
73-
${{ else }}:
74-
artifact: BuildAssetsInternal
53+
artifact: BuildAssetsInternal
7554
- ${{ if parameters.publishSymbols }}:
7655
- output: pipelineArtifact
7756
path: $(Pipeline.Workspace)/Symbols
78-
${{ if parameters.public }}:
79-
artifact: Symbols
80-
${{ else }}:
81-
artifact: SymbolsInternal
57+
artifact: SymbolsInternal
8258

8359
steps:
8460
- template: ../steps/checkout-windows-task.yml
@@ -96,40 +72,9 @@ stages:
9672
-destination-url '$(blobDestinationUrl)' `
9773
-branch '$(PublishBranchAlias)' `
9874
-o '$(Pipeline.Workspace)/Binaries Signed/assets.json'
99-
displayName: 'Create build asset JSON'
100-
101-
- ${{ if parameters.public }}:
102-
- task: AzureCLI@2
103-
displayName: Upload to blob storage
104-
inputs:
105-
azureSubscription: GoLang
106-
scriptType: bash
107-
scriptLocation: inlineScript
108-
# Send literal '*' to az: it handles the wildcard itself. Az copy only accepts one
109-
# "from" argument, so we can't use the shell's wildcard expansion.
110-
inlineScript: |
111-
az storage copy -s '*' -d '$(blobDestinationUrl)' --sas-token '$(dotnetbuildoutput-golang-write-sas-query)'
112-
workingDirectory: '$(Pipeline.Workspace)/Binaries Signed/'
113-
- ${{ else }}:
114-
- task: AzureFileCopy@6
115-
displayName: Upload to blob storage
116-
inputs:
117-
Destination: AzureBlob
118-
azureSubscription: golang-pme-storage
119-
storage: $(blobBackupAccount)
120-
ContainerName: microsoft
121-
SourcePath: '$(Pipeline.Workspace)/Binaries Signed/*'
122-
BlobPrefix: $(blobPrefix)
123-
124-
- pwsh: |
125-
Write-Host 'Generated links to artifacts in blob storage:'
126-
Write-Host ''
127-
Get-ChildItem -File -Path '.' | %{
128-
Write-Host "$(blobDestinationUrl)/$($_.Name)"
129-
}
130-
displayName: Show expected uploaded URLs
131-
workingDirectory: '$(Pipeline.Workspace)/Binaries Signed/'
75+
displayName: '🧾 Create build asset JSON'
13276
77+
# Gather symbols from all builders.
13378
- ${{ if eq(parameters.publishSymbols, true) }}:
13479
- ${{ each builder in parameters.builders }}:
13580
- ${{ if eq(parameters.publishExistingRunID, 'nil') }}:
@@ -164,8 +109,62 @@ stages:
164109
}
165110
Copy-Item $_.FullName $flatDir
166111
}
167-
displayName: 'Flatten: Symbols ${{ builder.id }}'
112+
displayName: '🫓 Flatten: Symbols ${{ builder.id }}'
168113
workingDirectory: '$(Pipeline.Workspace)'
114+
115+
- stage: Publish
116+
displayName: Publish Internal
117+
dependsOn: PrePublish
118+
119+
jobs:
120+
- job: Publish
121+
pool: ${{ parameters.pool }}
122+
123+
variables:
124+
- template: ../variables/publish-internal.yml
125+
126+
workspace:
127+
clean: all
128+
129+
templateContext:
130+
type: releaseJob # https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/releasepipelines/releaseworkflows/releasejob
131+
isProduction: true
132+
inputs:
133+
- input: pipelineArtifact
134+
artifactName: BuildAssetsInternal
135+
- ${{ if parameters.publishSymbols }}:
136+
- input: pipelineArtifact
137+
artifactName: SymbolsInternal
138+
path: $(Pipeline.Workspace)/Symbols
139+
140+
steps:
141+
- template: ../steps/find-PublishBranchAlias-task.yml
142+
143+
- template: ../steps/download-signed-binaries-task.yml
144+
parameters:
145+
runID: ${{ parameters.publishExistingRunID }}
146+
ReleaseJob: true
147+
148+
- task: AzureFileCopy@6
149+
displayName: ↗️ Upload to blob storage
150+
inputs:
151+
Destination: AzureBlob
152+
azureSubscription: golang-pme-storage
153+
storage: $(blobBackupAccount)
154+
ContainerName: microsoft
155+
SourcePath: '$(Pipeline.Workspace)/Binaries Signed/*'
156+
BlobPrefix: $(blobPrefix)
157+
158+
- pwsh: |
159+
Write-Host 'Generated links to artifacts in blob storage:'
160+
Write-Host ''
161+
Get-ChildItem -File -Path '.' | %{
162+
Write-Host "$(blobDestinationUrl)/$($_.Name)"
163+
}
164+
displayName: 🧾 Show expected uploaded URLs
165+
workingDirectory: '$(Pipeline.Workspace)/Binaries Signed/'
166+
167+
- ${{ if parameters.publishSymbols }}:
169168
- task: PublishSymbols@2
170169
inputs:
171170
SymbolsFolder: $(Pipeline.Workspace)/Symbols
@@ -175,4 +174,4 @@ stages:
175174
# in the AzDO repo, but we pull them at build time using a git submodule.
176175
# See https://github.com/microsoft/go-lab/issues/67.
177176
IndexSources: false
178-
displayName: Publish symbols
177+
displayName: ↗️ Publish symbols

eng/pipeline/steps/download-signed-binaries-task.yml

+30-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,43 @@ parameters:
99
type: string
1010
default: 'nil'
1111

12+
- name: ReleaseJob
13+
type: boolean
14+
default: false
15+
1216
steps:
13-
- ${{ if eq(parameters.runID, 'nil') }}:
17+
- ${{ if parameters.ReleaseJob }}:
18+
19+
- task: 1ES.DownloadPipelineArtifact@1
20+
displayName: 'Download: Binaries Signed'
21+
inputs:
22+
${{ if eq(parameters.runID, 'nil') }}:
23+
buildType: current
24+
${{ else }}:
25+
buildType: specific
26+
runVersion: 'specific'
27+
runId: ${{ parameters.runID }}
28+
project: $(System.TeamProject)
29+
definition: $(System.DefinitionId)
30+
artifactName: Binaries Signed
31+
targetPath: '$(Pipeline.Workspace)/Binaries Signed'
32+
33+
# The 1ES step tries to validate the SBOM manifests after download, so we can't assign
34+
# 'patterns' to filter them out. Instead, remove them after validation is done.
35+
- pwsh: |
36+
Remove-Item -Path '$(Pipeline.Workspace)/Binaries Signed/_manifest' -Recurse -Force
37+
displayName: Delete SBOM manifests
38+
39+
- ${{ elseif eq(parameters.runID, 'nil') }}:
40+
1441
- download: current
1542
artifact: Binaries Signed
1643
# Filter out manifests added by 1ES pipeline template.
1744
patterns: '!_manifest/**'
1845
displayName: 'Download: Binaries Signed'
46+
1947
- ${{ else }}:
48+
2049
- task: DownloadPipelineArtifact@2
2150
displayName: 'Download: Binaries Signed (Specific)'
2251
inputs:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Use of this source code is governed by a BSD-style
3+
# license that can be found in the LICENSE file.
4+
5+
# Variables that determine where to publish internal artifacts.
6+
7+
variables:
8+
- name: blobBackupAccount
9+
value: golangartifactsbackup
10+
- name: blobContainer
11+
value: 'https://$(blobBackupAccount).blob.core.windows.net/microsoft'
12+
- name: blobPrefix
13+
value: '$(PublishBranchAlias)/$(Build.BuildNumber)'
14+
- name: blobDestinationUrl
15+
value: '$(blobContainer)/$(blobPrefix)'

go

Submodule go updated from 39f2032 to e5b51eb

0 commit comments

Comments
 (0)