Skip to content
Closed
134 changes: 97 additions & 37 deletions .azure-pipelines/1ES.Release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
# Single entry point for MXC package releases: one run can publish the npm SDK,
# the Rust crate closure to crates.io, or both, via the `publishNpm` /
# `publishCrates` parameters. Both publish through ESRP Release (no registry
# tokens in this repo), consuming artifacts from `MXC-Official-Build`:
# * npm SDK -> `mxc-npm-sdk-package` (Package.NpmSdk.Job.yml)
# * crates.io -> `mxc-crates-package` (Package.Crates.Job.yml)
# Leaf-first crate ordering/verification lives in templates/Publish.CratesIo.Job.yml.
#
# One-time enablement (out of band): OSPO OSS-release registration, crate-name
# reservation under `microsoft-oss-releases`, and ESRP `Rust` content-type
# onboarding for the ESRP client id (see the ESRP crates.io docs). No
# CARGO_REGISTRY_TOKEN or variable group is needed -- ESRP owns the credentials.

trigger: none
name: $(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
Expand All @@ -10,14 +23,49 @@ resources:
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
pipelines:
# Reference pipeline that created the signed npm artifacts so we can consume them later
# Reference pipeline that created the signed release artifacts so we can consume them later
- pipeline: MXC
source: 'MXC-Official-Build'
trigger: none


# Parameters for ESRP release info will be passed from the ADO UI.
parameters:
- name: publishNpm
displayName: "Publish the npm SDK to npmjs.com"
type: boolean
default: false
- name: publishCrates

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the existing release pipeline's default behavior: publishNpm is now false, while publishCrates is also false. A default queue operation that previously published npm now selects no publication target (and may leave the expanded stages list empty, depending on template validation).

Please either preserve the npm default or add an unconditional validation stage that fails clearly when neither target is selected, so the default run cannot silently become a no-op.

displayName: "Publish the Rust crate closure to crates.io"
type: boolean
default: false
- name: cratesDryRun
displayName: "Crates dry run: stage + verify only, skip the ESRP publish"
type: boolean
default: false
# Leaf-first crate order for crates.io. MUST match the CRATES list in
# .azure-pipelines/scripts/crates_release.py; verified at run time by
# `verify-order`, which fails the release if the two disagree.
#
# WARNING: this default is a KNOWN-INCOMPLETE placeholder (an outdated 10-crate
# closure). The real mxc-sdk closure is 17 crates -- a refactor added the
# `mxc_engine` hub crate. Do NOT set publishCrates=true until this list is
# reconciled to the final closure AND the blockers in crates_release.py's CRATES
# comment are resolved (7 path deps missing `version`; isolation_session_bindings
# is publish=false; OSPO OSS-release setup + crate-name reservation).
- name: crateOrder
type: object
default:
- mxc_telemetry
- nanvix_common
- mxc_pty
- sandbox_spec
- wxc_common
- lxc_common
- seatbelt_common
- appcontainer_common
- bwrap_common
- mxc-sdk
- name: ESRPInfo
type: object
default:
Expand Down Expand Up @@ -47,42 +95,54 @@ extends:
os: windows

stages:
- stage: Publish_to_NPM
displayName: 'Publish NPM Package'
variables:
- name: release_environment
value: Production
jobs:
- job: ReleaseJob
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: MXC
targetPath: '$(Pipeline.Workspace)/packages'
artifactName: mxc-npm-sdk-package
- ${{ if parameters.publishNpm }}:
- stage: Publish_to_NPM
displayName: 'Publish NPM Package'
variables:
- name: release_environment
value: Production
jobs:
- job: ReleaseJob
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
pipeline: MXC
targetPath: '$(Pipeline.Workspace)/packages'
artifactName: mxc-npm-sdk-package

displayName: Publish to NPM
steps:
- task: EsrpRelease@10
displayName: 'Publish to NPM'
inputs:
connectedservicename: ${{ parameters.ESRPInfo.serviceName }}
usemanagedidentity: false
keyvaultname: ${{ parameters.ESRPInfo.azureKeyVaultName }}
authcertname: ${{ parameters.ESRPInfo.authCertName }}
signcertname: ${{ parameters.ESRPInfo.signCertName }}
clientid: ${{ parameters.ESRPInfo.clientId }}
intent: 'PackageDistribution'
contenttype: npm
contentsource: 'Folder'
folderlocation: '$(Pipeline.Workspace)/packages'
owners: ${{ parameters.ESRPInfo.OwnersEmail }}
approvers: ${{ parameters.ESRPInfo.ApproversEmail }}
waitforreleasecompletion: true
serviceendpointurl: 'https://api.esrp.microsoft.com'
mainpublisher: ESRPRELPACMAN
domaintenantid: ${{ parameters.ESRPInfo.tenantId }}

displayName: Publish to NPM
steps:
- task: EsrpRelease@10
displayName: 'Publish to NPM'
inputs:
connectedservicename: ${{ parameters.ESRPInfo.serviceName }}
usemanagedidentity: false
keyvaultname: ${{ parameters.ESRPInfo.azureKeyVaultName }}
authcertname: ${{ parameters.ESRPInfo.authCertName }}
signcertname: ${{ parameters.ESRPInfo.signCertName }}
clientid: ${{ parameters.ESRPInfo.clientId }}
intent: 'PackageDistribution'
contenttype: npm
contentsource: 'Folder'
folderlocation: '$(Pipeline.Workspace)/packages'
owners: ${{ parameters.ESRPInfo.OwnersEmail }}
approvers: ${{ parameters.ESRPInfo.ApproversEmail }}
waitforreleasecompletion: true
serviceendpointurl: 'https://api.esrp.microsoft.com'
mainpublisher: ESRPRELPACMAN
domaintenantid: ${{ parameters.ESRPInfo.tenantId }}
- ${{ if parameters.publishCrates }}:
- stage: Publish_to_CratesIo
displayName: 'Publish Crates.io Packages'
dependsOn: []
jobs:
- template: templates/Publish.CratesIo.Job.yml@self
parameters:
ESRPInfo: ${{ parameters.ESRPInfo }}
crateOrder: ${{ parameters.crateOrder }}
cratesDryRun: ${{ parameters.cratesDryRun }}


Loading
Loading