Skip to content

Commit 29880ec

Browse files
[main] Update dependencies from dotnet/arcade (#479)
[main] Update dependencies from dotnet/arcade
1 parent b64bce0 commit 29880ec

12 files changed

+236
-6
lines changed

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
<ProductDependencies>
44
</ProductDependencies>
55
<ToolsetDependencies>
6-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24311.3">
6+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="8.0.0-beta.24321.3">
77
<Uri>https://github.com/dotnet/arcade</Uri>
8-
<Sha>c214b6ad17aedca4fa48294d80f6c52ef2463081</Sha>
8+
<Sha>a95bcc256e9bdf47394e4dab04872811c16daaea</Sha>
99
</Dependency>
10-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.24311.3">
10+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="8.0.0-beta.24321.3">
1111
<Uri>https://github.com/dotnet/arcade</Uri>
12-
<Sha>c214b6ad17aedca4fa48294d80f6c52ef2463081</Sha>
12+
<Sha>a95bcc256e9bdf47394e4dab04872811c16daaea</Sha>
1313
</Dependency>
1414
</ToolsetDependencies>
1515
</Dependencies>

eng/common/templates-official/job/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ parameters:
3131
# container and pool.
3232
platform: {}
3333

34+
# If set to true and running on a non-public project,
35+
# Internal blob storage locations will be enabled.
36+
# This is not enabled by default because many repositories do not need internal sources
37+
# and do not need to have the required service connections approved in the pipeline.
38+
enableInternalSources: false
39+
3440
jobs:
3541
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
3642
displayName: Source-Build (${{ parameters.platform.name }})
@@ -62,6 +68,8 @@ jobs:
6268
clean: all
6369

6470
steps:
71+
- ${{ if eq(parameters.enableInternalSources, true) }}:
72+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
6573
- template: /eng/common/templates-official/steps/source-build.yml
6674
parameters:
6775
platform: ${{ parameters.platform }}

eng/common/templates-official/jobs/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ parameters:
2121
# one job runs on 'defaultManagedPlatform'.
2222
platforms: []
2323

24+
# If set to true and running on a non-public project,
25+
# Internal nuget and blob storage locations will be enabled.
26+
# This is not enabled by default because many repositories do not need internal sources
27+
# and do not need to have the required service connections approved in the pipeline.
28+
enableInternalSources: false
29+
2430
jobs:
2531

2632
- ${{ if ne(parameters.allCompletedJobId, '') }}:
@@ -38,9 +44,11 @@ jobs:
3844
parameters:
3945
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4046
platform: ${{ platform }}
47+
enableInternalSources: ${{ parameters.enableInternalSources }}
4148

4249
- ${{ if eq(length(parameters.platforms), 0) }}:
4350
- template: /eng/common/templates-official/job/source-build.yml
4451
parameters:
4552
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4653
platform: ${{ parameters.defaultManagedPlatform }}
54+
enableInternalSources: ${{ parameters.enableInternalSources }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64'
2+
# variable with the base64-encoded SAS token, by default
3+
4+
parameters:
5+
- name: federatedServiceConnection
6+
type: string
7+
default: 'dotnetbuilds-internal-read'
8+
- name: outputVariableName
9+
type: string
10+
default: 'dotnetbuilds-internal-container-read-token-base64'
11+
- name: expiryInHours
12+
type: number
13+
default: 1
14+
- name: base64Encode
15+
type: boolean
16+
default: true
17+
18+
steps:
19+
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
20+
- template: /eng/common/templates-official/steps/get-delegation-sas.yml
21+
parameters:
22+
federatedServiceConnection: ${{ parameters.federatedServiceConnection }}
23+
outputVariableName: ${{ parameters.outputVariableName }}
24+
expiryInHours: ${{ parameters.expiryInHours }}
25+
base64Encode: ${{ parameters.base64Encode }}
26+
storageAccount: dotnetbuilds
27+
container: internal
28+
permissions: rl
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
parameters:
2+
- name: federatedServiceConnection
3+
type: string
4+
- name: outputVariableName
5+
type: string
6+
- name: expiryInHours
7+
type: number
8+
default: 1
9+
- name: base64Encode
10+
type: boolean
11+
default: false
12+
- name: storageAccount
13+
type: string
14+
- name: container
15+
type: string
16+
- name: permissions
17+
type: string
18+
default: 'rl'
19+
20+
steps:
21+
- task: AzureCLI@2
22+
displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}'
23+
inputs:
24+
azureSubscription: ${{ parameters.federatedServiceConnection }}
25+
scriptType: 'pscore'
26+
scriptLocation: 'inlineScript'
27+
inlineScript: |
28+
# Calculate the expiration of the SAS token and convert to UTC
29+
$expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
30+
31+
$sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv
32+
33+
if ($LASTEXITCODE -ne 0) {
34+
Write-Error "Failed to generate SAS token."
35+
exit 1
36+
}
37+
38+
if ('${{ parameters.base64Encode }}' -eq 'true') {
39+
$sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas))
40+
}
41+
42+
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
43+
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
parameters:
2+
- name: federatedServiceConnection
3+
type: string
4+
- name: outputVariableName
5+
type: string
6+
# Resource to get a token for. Common values include:
7+
# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps
8+
# - 'https://storage.azure.com/' for storage
9+
# Defaults to Azure DevOps
10+
- name: resource
11+
type: string
12+
default: '499b84ac-1321-427f-aa17-267ca6975798'
13+
14+
steps:
15+
- task: AzureCLI@2
16+
displayName: 'Getting federated access token for feeds'
17+
inputs:
18+
azureSubscription: ${{ parameters.federatedServiceConnection }}
19+
scriptType: 'pscore'
20+
scriptLocation: 'inlineScript'
21+
inlineScript: |
22+
$accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv
23+
if ($LASTEXITCODE -ne 0) {
24+
Write-Error "Failed to get access token for resource '${{ parameters.resource }}'"
25+
exit 1
26+
}
27+
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
28+
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken"

eng/common/templates/job/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ parameters:
3131
# container and pool.
3232
platform: {}
3333

34+
# If set to true and running on a non-public project,
35+
# Internal blob storage locations will be enabled.
36+
# This is not enabled by default because many repositories do not need internal sources
37+
# and do not need to have the required service connections approved in the pipeline.
38+
enableInternalSources: false
39+
3440
jobs:
3541
- job: ${{ parameters.jobNamePrefix }}_${{ parameters.platform.name }}
3642
displayName: Source-Build (${{ parameters.platform.name }})
@@ -61,6 +67,8 @@ jobs:
6167
clean: all
6268

6369
steps:
70+
- ${{ if eq(parameters.enableInternalSources, true) }}:
71+
- template: /eng/common/templates/steps/enable-internal-runtimes.yml
6472
- template: /eng/common/templates/steps/source-build.yml
6573
parameters:
6674
platform: ${{ parameters.platform }}

eng/common/templates/jobs/source-build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ parameters:
2121
# one job runs on 'defaultManagedPlatform'.
2222
platforms: []
2323

24+
# If set to true and running on a non-public project,
25+
# Internal nuget and blob storage locations will be enabled.
26+
# This is not enabled by default because many repositories do not need internal sources
27+
# and do not need to have the required service connections approved in the pipeline.
28+
enableInternalSources: false
29+
2430
jobs:
2531

2632
- ${{ if ne(parameters.allCompletedJobId, '') }}:
@@ -38,9 +44,11 @@ jobs:
3844
parameters:
3945
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4046
platform: ${{ platform }}
47+
enableInternalSources: ${{ parameters.enableInternalSources }}
4148

4249
- ${{ if eq(length(parameters.platforms), 0) }}:
4350
- template: /eng/common/templates/job/source-build.yml
4451
parameters:
4552
jobNamePrefix: ${{ parameters.jobNamePrefix }}
4653
platform: ${{ parameters.defaultManagedPlatform }}
54+
enableInternalSources: ${{ parameters.enableInternalSources }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Obtains internal runtime download credentials and populates the 'dotnetbuilds-internal-container-read-token-base64'
2+
# variable with the base64-encoded SAS token, by default
3+
4+
parameters:
5+
- name: federatedServiceConnection
6+
type: string
7+
default: 'dotnetbuilds-internal-read'
8+
- name: outputVariableName
9+
type: string
10+
default: 'dotnetbuilds-internal-container-read-token-base64'
11+
- name: expiryInHours
12+
type: number
13+
default: 1
14+
- name: base64Encode
15+
type: boolean
16+
default: true
17+
18+
steps:
19+
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
20+
- template: /eng/common/templates/steps/get-delegation-sas.yml
21+
parameters:
22+
federatedServiceConnection: ${{ parameters.federatedServiceConnection }}
23+
outputVariableName: ${{ parameters.outputVariableName }}
24+
expiryInHours: ${{ parameters.expiryInHours }}
25+
base64Encode: ${{ parameters.base64Encode }}
26+
storageAccount: dotnetbuilds
27+
container: internal
28+
permissions: rl
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
parameters:
2+
- name: federatedServiceConnection
3+
type: string
4+
- name: outputVariableName
5+
type: string
6+
- name: expiryInHours
7+
type: number
8+
default: 1
9+
- name: base64Encode
10+
type: boolean
11+
default: false
12+
- name: storageAccount
13+
type: string
14+
- name: container
15+
type: string
16+
- name: permissions
17+
type: string
18+
default: 'rl'
19+
20+
steps:
21+
- task: AzureCLI@2
22+
displayName: 'Generate delegation SAS Token for ${{ parameters.storageAccount }}/${{ parameters.container }}'
23+
inputs:
24+
azureSubscription: ${{ parameters.federatedServiceConnection }}
25+
scriptType: 'pscore'
26+
scriptLocation: 'inlineScript'
27+
inlineScript: |
28+
# Calculate the expiration of the SAS token and convert to UTC
29+
$expiry = (Get-Date).AddHours(${{ parameters.expiryInHours }}).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
30+
31+
$sas = az storage container generate-sas --account-name ${{ parameters.storageAccount }} --name ${{ parameters.container }} --permissions ${{ parameters.permissions }} --expiry $expiry --auth-mode login --as-user -o tsv
32+
33+
if ($LASTEXITCODE -ne 0) {
34+
Write-Error "Failed to generate SAS token."
35+
exit 1
36+
}
37+
38+
if ('${{ parameters.base64Encode }}' -eq 'true') {
39+
$sas = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($sas))
40+
}
41+
42+
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
43+
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$sas"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
parameters:
2+
- name: federatedServiceConnection
3+
type: string
4+
- name: outputVariableName
5+
type: string
6+
# Resource to get a token for. Common values include:
7+
# - '499b84ac-1321-427f-aa17-267ca6975798' for Azure DevOps
8+
# - 'https://storage.azure.com/' for storage
9+
# Defaults to Azure DevOps
10+
- name: resource
11+
type: string
12+
default: '499b84ac-1321-427f-aa17-267ca6975798'
13+
14+
steps:
15+
- task: AzureCLI@2
16+
displayName: 'Getting federated access token for feeds'
17+
inputs:
18+
azureSubscription: ${{ parameters.federatedServiceConnection }}
19+
scriptType: 'pscore'
20+
scriptLocation: 'inlineScript'
21+
inlineScript: |
22+
$accessToken = az account get-access-token --query accessToken --resource ${{ parameters.resource }} --output tsv
23+
if ($LASTEXITCODE -ne 0) {
24+
Write-Error "Failed to get access token for resource '${{ parameters.resource }}'"
25+
exit 1
26+
}
27+
Write-Host "Setting '${{ parameters.outputVariableName }}' with the access token value"
28+
Write-Host "##vso[task.setvariable variable=${{ parameters.outputVariableName }};issecret=true]$accessToken"

global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"dotnet": "8.0.101"
44
},
55
"msbuild-sdks": {
6-
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24311.3",
7-
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24311.3"
6+
"Microsoft.DotNet.Arcade.Sdk": "8.0.0-beta.24321.3",
7+
"Microsoft.DotNet.Helix.Sdk": "8.0.0-beta.24321.3"
88
}
99
}

0 commit comments

Comments
 (0)