Skip to content

Commit 2fb256c

Browse files
authored
Merge pull request #595 from microsoft/wiktork-microsoft-port-release-pipeline-to-main
Migrate release pipeline 901 to YAML + update deprecated GH actions
2 parents 7883e15 + be19171 commit 2fb256c

5 files changed

Lines changed: 169 additions & 7 deletions

File tree

.github/workflows/build.yml.disabled

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
3030

31-
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
31+
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3232
with:
3333
path: out/packages
3434
key: nuget
@@ -37,14 +37,14 @@ jobs:
3737

3838
- name: archive so
3939
if: matrix.os == 'ubuntu-latest'
40-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
40+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4141
with:
4242
name: libInstrumentationEngine.so
4343
path: out/Linux/bin/x64.Release/ClrInstrumentationEngine/libInstrumentationEngine.so
4444

4545
- name: archive dylib
4646
if: matrix.os == 'macos-latest'
47-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
47+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4848
with:
4949
name: libInstrumentationEngine.dylib
5050
path: out/OSX/bin/x64.Release/ClrInstrumentationEngine/libInstrumentationEngine.dylib

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
6464
# format to the repository Actions tab.
6565
- name: "Upload artifact"
66-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
66+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
6767
with:
6868
name: SARIF file
6969
path: results.sarif

build/yaml/pipelines/release.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# Release Pipeline: CLR Instrumentation Engine Release
5+
#
6+
# Migrated from the classic release definition "CLR Instrumentation Engine Release"
7+
# (https://devdiv.visualstudio.com/DevDiv/_release?definitionId=901).
8+
#
9+
# Consumes the signed build artifacts produced by the "Signed" build
10+
# (build definition 11311 / ClrInstrumentationEngine-Signed-Yaml, see signed.yaml)
11+
# and publishes the release.
12+
#
13+
# Currently only the first classic stage is migrated:
14+
# - Publish NuGets to the internal InstrumentationEngine feed (+ optional promote to Release view)
15+
# The remaining classic environments (preinstalled zip, drop upload/retain, NuGet.org headers,
16+
# VS feed, VS insertion, symbol/source archival) will be migrated separately.
17+
#
18+
# NOTE: This pipeline must be run manually after the Signed build completes.
19+
# Stage approvals are enforced via Azure DevOps Environment checks (see stages/release.yaml).
20+
21+
name: $(date:yyyyMMdd)$(rev:rr)
22+
23+
trigger: none
24+
pr: none
25+
26+
variables:
27+
TeamName: VS Production Diagnostics
28+
29+
# Map the classic $(System.ArtifactsDirectory) onto the YAML pipeline-resource workspace.
30+
# Pipeline-resource artifacts download to $(Pipeline.Workspace)\<resource alias>\<artifact name>.
31+
ArtifactsDirectory: $(Pipeline.Workspace)
32+
33+
# ---- Artifact path patterns (relative to ArtifactsDirectory) ----
34+
WindowsInstrumentationEngineNuGetArtifactPathPattern: ClrInstrumentationEngine-Signed-Yaml\packages-windows-Release\**\Microsoft.InstrumentationEngine*.nupkg
35+
LinuxInstrumentationEngineNuGetArtifactPathPattern: ClrInstrumentationEngine-Signed-Yaml\packages-linux-*-Release\**\Microsoft.InstrumentationEngine*.nupkg
36+
37+
# ---- Contacts ----
38+
TeamContact: clrieowners@microsoft.com
39+
40+
# Set to 'True' (e.g. at queue time) to promote the published packages to the Release view.
41+
PromoteToRelease: 'False'
42+
43+
resources:
44+
repositories:
45+
- repository: MicroBuildTemplate
46+
type: git
47+
name: 1ESPipelineTemplates/MicroBuildTemplate
48+
ref: refs/tags/release
49+
50+
pipelines:
51+
# The signed build that produces the release artifacts (build definition 11311).
52+
# The alias is kept identical to the classic release artifact alias so that the
53+
# downloaded artifact paths line up with the patterns above.
54+
- pipeline: ClrInstrumentationEngine-Signed-Yaml
55+
project: DevDiv
56+
source: ClrInstrumentationEngine-Signed-Yaml
57+
trigger: none
58+
59+
extends:
60+
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
61+
parameters:
62+
pool:
63+
name: VSEngSS-Microbuild2022-1ES
64+
os: windows
65+
sdl:
66+
sourceAnalysisPool:
67+
name: VSEngSS-MicroBuild2022-1ES
68+
os: windows
69+
# This pipeline only consumes already-signed/scanned artifacts and publishes them.
70+
binskim:
71+
enabled: false
72+
justificationForDisabling: 'Release pipeline only consumes already-scanned signed artifacts; BinSkim runs in the build pipeline.'
73+
74+
stages:
75+
- template: ../stages/release.yaml@self

build/yaml/stages/release.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Copyright (c) Microsoft Corporation. All rights reserved.
2+
# Licensed under the MIT License.
3+
4+
# Stages Template: CLR Instrumentation Engine Release
5+
#
6+
# Migrated from the classic release definition 901. Only the first classic environment,
7+
# "Publish NuGets to internal InstrumentationEngine Feed", is migrated for now; the
8+
# remaining environments (preinstalled zip, drop upload/retain, NuGet.org headers, VS feed,
9+
# VS insertion, symbol/source archival) will be migrated separately.
10+
#
11+
# The stage has a pre-deploy approval in the classic definition and is modeled as a
12+
# deployment job targeting an Azure DevOps Environment; configure the matching approval
13+
# check on that environment:
14+
#
15+
# Environment Classic pre-deploy approver
16+
# ---------------------------------- ----------------------------------------
17+
# CLRIE-Release-Internal-NuGet-Feed [DevDiv]\CLR Instrumentation Engine
18+
19+
stages:
20+
21+
# =====================================================================================
22+
# Publish NuGets to internal InstrumentationEngine Feed
23+
# =====================================================================================
24+
- stage: PublishNuGetsInternalFeed
25+
displayName: Publish NuGets to internal InstrumentationEngine Feed
26+
dependsOn: []
27+
jobs:
28+
- deployment: Publish
29+
displayName: Publish NuGets to internal InstrumentationEngine Feed
30+
environment: CLRIE-Release-Internal-NuGet-Feed
31+
strategy:
32+
runOnce:
33+
deploy:
34+
steps:
35+
- download: none
36+
- download: ClrInstrumentationEngine-Signed-Yaml
37+
artifact: packages-windows-Release
38+
patterns: '**/Microsoft.InstrumentationEngine*.nupkg'
39+
displayName: Download Windows packages
40+
- download: ClrInstrumentationEngine-Signed-Yaml
41+
artifact: packages-linux-ubuntu-Release
42+
patterns: '**/Microsoft.InstrumentationEngine*.nupkg'
43+
displayName: Download Linux (ubuntu) packages
44+
- download: ClrInstrumentationEngine-Signed-Yaml
45+
artifact: packages-linux-alpine-Release
46+
patterns: '**/Microsoft.InstrumentationEngine*.nupkg'
47+
displayName: Download Linux (alpine) packages
48+
49+
- task: NuGetAuthenticate@1
50+
displayName: NuGet Authenticate
51+
52+
- task: NuGetCommand@2
53+
displayName: Push to DevDiv InstrumentationEngine feed
54+
inputs:
55+
command: push
56+
nuGetFeedType: internal
57+
publishVstsFeed: 59c1dfae-dea5-4ea5-ac83-c9abcb4ac339
58+
packagesToPush: $(ArtifactsDirectory)\$(WindowsInstrumentationEngineNuGetArtifactPathPattern);$(ArtifactsDirectory)\$(LinuxInstrumentationEngineNuGetArtifactPathPattern)
59+
allowPackageConflicts: true
60+
publishPackageMetadata: true
61+
verbosityPush: Detailed
62+
63+
# Classic equivalent: "Promote package to Release View" (deprecated marketplace task,
64+
# gated on PromoteToRelease). Implemented here against the Azure Artifacts packaging
65+
# REST API; only runs when PromoteToRelease is set to 'True'.
66+
- task: PowerShell@2
67+
displayName: Promote package to Release View
68+
condition: and(succeeded(), eq(variables['PromoteToRelease'], 'True'))
69+
env:
70+
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
71+
inputs:
72+
targetType: inline
73+
script: |
74+
$feedId = '59c1dfae-dea5-4ea5-ac83-c9abcb4ac339'
75+
$headers = @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" }
76+
$root = Join-Path $env:ArtifactsDirectory 'ClrInstrumentationEngine-Signed-Yaml'
77+
Get-ChildItem -Path $root -Recurse -Filter *.nupkg | ForEach-Object {
78+
if ($_.Name -match '^(?<id>.+?)\.(?<ver>\d+\..*)\.nupkg$') {
79+
$id = $Matches.id; $ver = $Matches.ver
80+
$uri = "https://pkgs.dev.azure.com/DevDiv/_apis/packaging/feeds/$feedId/nuget/packages/$id/versions/$ver?api-version=7.1-preview.1"
81+
$body = @{ views = @{ op = 'add'; path = '/views/-'; value = 'Release' } } | ConvertTo-Json -Depth 5
82+
Write-Host "Promoting $id $ver to Release view"
83+
Invoke-RestMethod -Uri $uri -Method Patch -Headers $headers -Body $body -ContentType 'application/json'
84+
}
85+
}

docs/release_process.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Based on the changes and targeted platform releases, impacted scenarios and part
1818
### Release Phase
1919
1. Once testing completes, PR to merge `main` branch to `release` branch
2020
2. Manually run the [Signed](https://devdiv.visualstudio.com/DevDiv/_build?definitionId=11311) build to create release artifacts
21-
3. Manually run the
22-
[CLR Instrumentation Engine Release](https://devdiv.visualstudio.com/DevDiv/_releases2?view=all&definitionId=901)
23-
pipeline which publishes artifacts with release version (eg. 1.0.15)
21+
3. Manually run the **CLR Instrumentation Engine Release** YAML pipeline
22+
([build/yaml/pipelines/release.yaml](../build/yaml/pipelines/release.yaml)) to publish NuGets to the internal
23+
InstrumentationEngine feed. This pipeline consumes the `Signed` build artifacts. The remaining release steps below
24+
are still performed via the legacy classic release definition
25+
([definitionId=901](https://devdiv.visualstudio.com/DevDiv/_releases2?view=all&definitionId=901)) until they are migrated.
2426
+ Publish NuGets to the internal NuGet feed and MSAzure (for Azure VM/VMSS WAD)
2527
+ Publish Preinstalled CLR Instrumentation Engine zip file to Azure App Service
2628
+ Publish msi/msm files to CDN and expose aka.ms links on this repo.

0 commit comments

Comments
 (0)