Skip to content
Merged
Show file tree
Hide file tree
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 Mar 15, 2024
d48f8ab
Added release.yml
SteveL-PowerShell Mar 15, 2024
d6b2c05
Renamed release.yml to DSC-Official.yml
SteveL-PowerShell Mar 15, 2024
512f5ba
Updated DSC-Official.yml
SteveL-PowerShell Mar 15, 2024
722254f
Remove use of old ComplianceRepo
SteveL-PowerShell Mar 15, 2024
dc63f21
remove additional use of ComplianceRepo
SteveL-PowerShell Mar 15, 2024
4213da7
Added tsaoptions.json
SteveL-PowerShell Mar 15, 2024
b0a06fd
Set repoRoot variable
SteveL-PowerShell Mar 15, 2024
4f2c622
Fix name of repo root
SteveL-PowerShell Mar 15, 2024
45db9cf
add location of tsaoptions.json
SteveL-PowerShell Mar 15, 2024
200bc4f
Have rustup-init not prompt
SteveL-PowerShell Mar 15, 2024
75c31cf
have rust install not prompt
SteveL-PowerShell Mar 15, 2024
664fe2e
add rust to path after install
SteveL-PowerShell Mar 15, 2024
498f6fa
fix linux and macOS pools
SteveL-PowerShell Mar 15, 2024
1fe8d33
fix typo
SteveL-PowerShell Mar 15, 2024
f8b6db5
fix using linux pool
SteveL-PowerShell Mar 15, 2024
8b01690
add workaround for known issue building rust in OneBranch on Windows
SteveL-PowerShell Mar 15, 2024
19848cc
set host architecture for arm64 linux
SteveL-PowerShell Mar 15, 2024
c68591c
fix codeql language
SteveL-PowerShell Mar 15, 2024
82db6db
use mariner images
SteveL-PowerShell Mar 15, 2024
a6ac2ad
fix install of rust on Linux
SteveL-PowerShell Mar 15, 2024
51a3b30
add tsaconfig path to more stages
SteveL-PowerShell Mar 15, 2024
4157225
add cargo to path after install on linux
SteveL-PowerShell Mar 16, 2024
7cf9dc5
install openssl-devel on mariner
SteveL-PowerShell Mar 16, 2024
a0c4cfb
fix destination path for archives
SteveL-MSFT Mar 16, 2024
b9763b6
update compliance steps
SteveL-PowerShell Mar 18, 2024
57b13e4
set repo root
SteveL-PowerShell Mar 18, 2024
59e0ff9
add whitespace between platform jobs
SteveL-PowerShell Mar 18, 2024
8567dd6
create output folder for Linux/macOS
SteveL-PowerShell Mar 18, 2024
34b4795
use root of artifact folder
SteveL-PowerShell Mar 18, 2024
ef9cc51
add signing variables
SteveL-PowerShell Mar 19, 2024
d216cf8
remove restore
SteveL-PowerShell Mar 19, 2024
81387df
remove unnecessary variable
SteveL-PowerShell Mar 19, 2024
026001c
add target to checkout
SteveL-PowerShell Mar 19, 2024
a9ef18d
remove unused file_lib project
SteveL-PowerShell Mar 19, 2024
241539c
delete old pipline
SteveL-PowerShell Mar 19, 2024
623cb69
add back variable as ADO complains
SteveL-PowerShell Mar 19, 2024
058119f
fix files being copied to be signed
SteveL-PowerShell Mar 19, 2024
e770261
add GitHub release step and building msixbundle
SteveL-PowerShell Mar 19, 2024
52a8096
add building msixbundle
SteveL-PowerShell Mar 19, 2024
a5c8c3b
define artifact base name
SteveL-PowerShell Mar 19, 2024
e93cd0f
remove changelog option
SteveL-PowerShell Mar 19, 2024
c9c5eb8
remove changelog option
SteveL-PowerShell Mar 19, 2024
d96e6b3
add trailing newline
SteveL-PowerShell Mar 19, 2024
5315f70
fix quoting
SteveL-PowerShell Mar 19, 2024
3e3fad7
fix job name
SteveL-PowerShell Mar 19, 2024
ab6746d
Merge branch 'main' into onebranch
SteveL-MSFT Mar 23, 2024
c6971e4
fix wrong end quote
SteveL-MSFT Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .config/tsaoptions.json
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"
]
}
283 changes: 283 additions & 0 deletions .pipelines/DSC-Official.yml
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
Loading