-
Notifications
You must be signed in to change notification settings - Fork 52
Update release pipeline #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
e187027
Updated release.yml
SteveL-PowerShell d48f8ab
Added release.yml
SteveL-PowerShell d6b2c05
Renamed release.yml to DSC-Official.yml
SteveL-PowerShell 512f5ba
Updated DSC-Official.yml
SteveL-PowerShell 722254f
Remove use of old ComplianceRepo
SteveL-PowerShell dc63f21
remove additional use of ComplianceRepo
SteveL-PowerShell 4213da7
Added tsaoptions.json
SteveL-PowerShell b0a06fd
Set repoRoot variable
SteveL-PowerShell 4f2c622
Fix name of repo root
SteveL-PowerShell 45db9cf
add location of tsaoptions.json
SteveL-PowerShell 200bc4f
Have rustup-init not prompt
SteveL-PowerShell 75c31cf
have rust install not prompt
SteveL-PowerShell 664fe2e
add rust to path after install
SteveL-PowerShell 498f6fa
fix linux and macOS pools
SteveL-PowerShell 1fe8d33
fix typo
SteveL-PowerShell f8b6db5
fix using linux pool
SteveL-PowerShell 8b01690
add workaround for known issue building rust in OneBranch on Windows
SteveL-PowerShell 19848cc
set host architecture for arm64 linux
SteveL-PowerShell c68591c
fix codeql language
SteveL-PowerShell 82db6db
use mariner images
SteveL-PowerShell a6ac2ad
fix install of rust on Linux
SteveL-PowerShell 51a3b30
add tsaconfig path to more stages
SteveL-PowerShell 4157225
add cargo to path after install on linux
SteveL-PowerShell 7cf9dc5
install openssl-devel on mariner
SteveL-PowerShell a0c4cfb
fix destination path for archives
SteveL-MSFT b9763b6
update compliance steps
SteveL-PowerShell 57b13e4
set repo root
SteveL-PowerShell 59e0ff9
add whitespace between platform jobs
SteveL-PowerShell 8567dd6
create output folder for Linux/macOS
SteveL-PowerShell 34b4795
use root of artifact folder
SteveL-PowerShell ef9cc51
add signing variables
SteveL-PowerShell d216cf8
remove restore
SteveL-PowerShell 81387df
remove unnecessary variable
SteveL-PowerShell 026001c
add target to checkout
SteveL-PowerShell a9ef18d
remove unused file_lib project
SteveL-PowerShell 241539c
delete old pipline
SteveL-PowerShell 623cb69
add back variable as ADO complains
SteveL-PowerShell 058119f
fix files being copied to be signed
SteveL-PowerShell e770261
add GitHub release step and building msixbundle
SteveL-PowerShell 52a8096
add building msixbundle
SteveL-PowerShell a5c8c3b
define artifact base name
SteveL-PowerShell e93cd0f
remove changelog option
SteveL-PowerShell c9c5eb8
remove changelog option
SteveL-PowerShell d96e6b3
add trailing newline
SteveL-PowerShell 5315f70
fix quoting
SteveL-PowerShell 3e3fad7
fix job name
SteveL-PowerShell ab6746d
Merge branch 'main' into onebranch
SteveL-MSFT c6971e4
fix wrong end quote
SteveL-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"instanceUrl": "https://msazure.visualstudio.com", | ||
"projectName": "One", | ||
"areaPath": "One\\MGMT\\Compute\\PowerShell Desired State Configuration", | ||
"notificationAliases": [ | ||
"anmenaga@microsoft.com", | ||
"slee@microsoft.com" | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,283 @@ | ||
name: DSC-Release-$(Build.BuildId) | ||
trigger: none | ||
|
||
pr: | ||
branches: | ||
include: | ||
- onebranch | ||
- release* | ||
|
||
variables: | ||
BuildConfiguration: 'release' | ||
PackageRoot: '$(System.ArtifactsDirectory)/Packages' | ||
LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0' | ||
WindowsContainerImage: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest | ||
|
||
resources: | ||
repositories: | ||
- repository: onebranchTemplates | ||
type: git | ||
name: OneBranch.Pipelines/GovernedTemplates | ||
ref: refs/heads/main | ||
|
||
extends: | ||
template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates | ||
parameters: | ||
customTags: 'ES365AIMigrationTooling' | ||
globalSdl: | ||
disableLegacyManifest: true | ||
sbom: | ||
enabled: true | ||
packageName: Microsoft.DSC | ||
codeql: | ||
compiled: | ||
enabled: true | ||
asyncSdl: # https://aka.ms/obpipelines/asyncsdl | ||
enabled: true | ||
forStages: [Build] | ||
credscan: | ||
enabled: true | ||
scanFolder: $(Build.SourcesDirectory)\DSC | ||
binskim: | ||
enabled: true | ||
apiscan: | ||
enabled: false | ||
|
||
stages: | ||
- stage: BuildAndSign | ||
displayName: Build Native Binaries | ||
dependsOn: [] | ||
jobs: | ||
- job: SetPackageVersion | ||
displayName: Set PackageVersion | ||
pool: | ||
type: windows | ||
variables: | ||
repoRoot: $(Build.SourcesDirectory)\DSC | ||
ob_sdl_tsa_configFile: $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
steps: | ||
- checkout: self | ||
target: host | ||
- pwsh: | | ||
$packageVersion = $(repoRoot)/build.ps1 -GetPackageVersion | ||
$vstsCommandString = "vso[task.setvariable variable=Version;isoutput=true]$packageVersion" | ||
Write-Host ("sending " + $vstsCommandString) | ||
Write-Host "##$vstsCommandString" | ||
name: Package | ||
|
||
- job: BuildWin | ||
dependsOn: SetPackageVersion | ||
strategy: | ||
matrix: | ||
Windows x64: | ||
buildName: x86_64-pc-windows-msvc | ||
Windows x64_arm64: | ||
buildName: aarch64-pc-windows-msvc | ||
variables: | ||
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] | ||
ob_sdl_tsa_configFile: $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
repoRoot: $(Build.SourcesDirectory)\DSC | ||
signSrcPath: $(repoRoot)/out | ||
ob_artifactBaseName: 'DSC-$(buildName)' | ||
ob_sdl_sbom_enabled: true | ||
ob_signing_setup_enabled: true | ||
ob_sdl_codeql_compiled_enabled: false | ||
pool: | ||
type: windows | ||
displayName: Build | ||
steps: | ||
- checkout: self | ||
target: host | ||
- task: CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step. | ||
inputs: | ||
Enabled: true | ||
AnalyzeInPipeline: true | ||
Language: rust | ||
- pwsh: | | ||
$tmpdir = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid()) | ||
New-Item -ItemType Directory -Path $tmpdir | ||
Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir" | ||
displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue | ||
- pwsh: | | ||
Set-Location "$(Build.SourcesDirectory)/DSC" | ||
./build.ps1 -Release -Architecture $(buildName) -SkipLinkCheck | ||
displayName: 'Build $(buildName)' | ||
condition: succeeded() | ||
- task: CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step. | ||
condition: always() | ||
- pwsh: | | ||
$null = New-Item -ItemType Directory -Path "$(PackageRoot)" -ErrorAction Ignore | ||
$null = New-Item -ItemType Directory -Path "$(PackageRoot)/out" -ErrorAction Ignore | ||
$outPath = New-Item -ItemType Directory -Path "$(PackageRoot)/out/$(buildName)" -ErrorAction Ignore | ||
# workaround known issue of building in OneBranch copying from TMP folder | ||
$null = New-Item -ItemType Directory -Path "$(signSrcPath)" -ErrorAction Ignore | ||
# copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign | ||
Copy-Item "$env:CARGO_TARGET_DIR/*.exe" "$(signSrcPath)" | ||
# Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/$(buildName)/$(BuildConfiguration)/*" -Destination $outPath -Verbose -Force | ||
displayName: Copy binaries | ||
condition: succeeded() | ||
- task: onebranch.pipeline.signing@1 | ||
displayName: Sign 1st party files | ||
inputs: | ||
command: 'sign' | ||
signing_profile: external_distribution | ||
files_to_sign: | | ||
*.exe; | ||
*.json; | ||
*.ps1; | ||
search_root: $(signSrcPath) | ||
- task: CopyFiles@2 | ||
displayName: "Copy signed files to ob_outputDirectory - '$(ob_outputDirectory)'" | ||
inputs: | ||
SourceFolder: "$(signSrcPath)" | ||
Contents: '*' | ||
TargetFolder: $(ob_outputDirectory) | ||
- pwsh: | | ||
compress-archive -Path "$(ob_outputDirectory)/*" -DestinationPath "$(ob_outputDirectory)/DSC-$(PackageVersion)-$(buildName).zip" | ||
displayName: 'Compress $(buildName)' | ||
condition: succeeded() | ||
- pwsh: | | ||
Set-Location "$(Build.SourcesDirectory)/DSC" | ||
./build.ps1 -msix -skipbuild | ||
Copy-Item *.msix "$(ob_outputDirectory)" | ||
displayName: 'Create msix for $(buildName)' | ||
condition: succeeded() | ||
|
||
- job: CreateMsixBundle | ||
dependsOn: BuildWin | ||
variables: | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
pool: | ||
type: windows | ||
steps: | ||
- pwsh: | | ||
Set-Location "$(Build.SourcesDirectory)/DSC" | ||
./build.ps1 -msixbundle | ||
displayName: 'Create msixbundle' | ||
condition: succeeded() | ||
|
||
- job: PublishSigned | ||
dependsOn: BuildWin | ||
variables: | ||
signOutPath: $[ dependencies.BuildWin.outputs['signOutPath.signOutPath'] ] | ||
ob_sdl_tsa_configFile: $(Build.SourcesDirectory)\DSC\.config\tsaoptions.json | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
pool: | ||
type: windows | ||
steps: | ||
- task: CopyFiles@2 | ||
displayName: "Copy Files for 'PublishPipelineArtifact@1' publish task" | ||
inputs: | ||
SourceFolder: $(signOutPath) | ||
Contents: '**' | ||
TargetFolder: $(Build.ArtifactStagingDirectory)/signed | ||
|
||
- job: BuildLinux | ||
dependsOn: SetPackageVersion | ||
variables: | ||
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
displayName: Linux-x64-gnu | ||
pool: | ||
type: linux | ||
steps: | ||
- pwsh: | | ||
./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu | ||
displayName: 'Build x86_64-unknown-linux-gnu' | ||
condition: succeeded() | ||
- pwsh: | | ||
tar czf '$(ob_outputDirectory)/DSC-$(PackageVersion)-x86_64-unknown-linux-gnu.tar.gz' -C $(Build.SourcesDirectory)/bin/x86_64-unknown-linux-gnu/$(BuildConfiguration) . | ||
displayName: 'Compress x86_64-unknown-linux-gnu' | ||
condition: succeeded() | ||
|
||
- job: BuildLinuxArm64 | ||
dependsOn: SetPackageVersion | ||
variables: | ||
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
displayName: Linux-ARM64-gnu | ||
pool: | ||
type: linux | ||
hostArchitecture: arm64 | ||
steps: | ||
- pwsh: | | ||
./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu | ||
displayName: 'Build aarch64-unknown-linux-gnu' | ||
condition: succeeded() | ||
- pwsh: | | ||
tar czf '$(ob_outputDirectory)/DSC-$(PackageVersion)-aarch64-unknown-linux-gnu.tar.gz' -C $(Build.SourcesDirectory)/bin/aarch64-unknown-linux-gnu/$(BuildConfiguration) . | ||
displayName: 'Compress aarch64-unknown-linux-gnu' | ||
condition: succeeded() | ||
|
||
- job: BuildMac | ||
dependsOn: SetPackageVersion | ||
variables: | ||
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] | ||
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' | ||
displayName: Build | ||
pool: | ||
type: linux | ||
isCustom: true | ||
name: Azure Pipelines | ||
vmImage: 'macOS-latest' | ||
strategy: | ||
matrix: | ||
macOS x64: | ||
buildName: x86_64-apple-darwin | ||
macOS arm64: | ||
buildName: aarch64-apple-darwin | ||
steps: | ||
- pwsh: | | ||
./build.ps1 -Release -Architecture $(buildName) | ||
displayName: 'Build $(buildName)' | ||
condition: succeeded() | ||
- pwsh: | | ||
tar czf '$(ob_outputDirectory)/DSC-$(PackageVersion)-$(buildName).tar.gz' -C $(Build.SourcesDirectory)/bin/$(buildName)/$(BuildConfiguration) . | ||
displayName: 'Compress $(buildName)' | ||
condition: succeeded() | ||
|
||
- stage: Release | ||
dependsOn: BuildAndSign | ||
variables: | ||
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] | ||
drop: $(Pipeline.Workspace)/drop_build_main | ||
jobs: | ||
- job: Validation | ||
displayName: Manual validation | ||
pool: | ||
type: agentless | ||
timeoutInMinutes: 1440 | ||
steps: | ||
- task: ManualValidation@0 | ||
displayName: Wait 24 hours for validation | ||
inputs: | ||
notifyUsers: $(Build.RequestedForEmail) | ||
instructions: Please validate the release | ||
timeoutInMinutes: 1440 | ||
- job: GitHub | ||
dependsOn: validation | ||
displayName: Publish draft to GitHub | ||
pool: | ||
type: windows | ||
variables: | ||
ob_outputDirectory: '$(Build.SourcesDirectory)' | ||
steps: | ||
- download: current | ||
displayName: Download artifacts | ||
- task: GitHubRelease@1 | ||
displayName: Create GitHub release | ||
inputs: | ||
gitHubConnection: GitHub | ||
repositoryName: PowerShell/DSC | ||
action: create | ||
assets: | | ||
*.zip; | ||
*.tar.gz; | ||
addChangeLog: true | ||
changeLogType: commitBased | ||
releaseNotesFilePath: CHANGELOG.md | ||
tagSource: gitTag | ||
tag: v$(version) | ||
isDraft: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.