Skip to content
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8cfc3fd
use esrp publishing
timotheeguerin Dec 11, 2025
25bc6f1
.
timotheeguerin Dec 11, 2025
6ec52fd
fix
timotheeguerin Dec 11, 2025
ebb9def
abc
timotheeguerin Dec 11, 2025
d8a91eb
speed up for testing
timotheeguerin Dec 11, 2025
313cf72
abc
timotheeguerin Dec 11, 2025
44aab72
f
timotheeguerin Dec 11, 2025
69e70e7
tweaks
timotheeguerin Dec 11, 2025
9ac204b
try this
timotheeguerin Dec 11, 2025
0a8b4bc
tweaks
timotheeguerin Dec 11, 2025
75f6dd9
abc
timotheeguerin Dec 11, 2025
6be8cdb
abc
timotheeguerin Dec 11, 2025
bbf5841
try this
timotheeguerin Dec 11, 2025
7ed9aa0
move
timotheeguerin Dec 11, 2025
431a646
fix
timotheeguerin Dec 11, 2025
29a2053
should work now
timotheeguerin Dec 11, 2025
21f93a3
try this
timotheeguerin Dec 11, 2025
48b6885
tweaks
timotheeguerin Dec 11, 2025
d3dca2c
fix
timotheeguerin Dec 11, 2025
1f35f5f
try this
timotheeguerin Dec 12, 2025
32f4a43
f
timotheeguerin Dec 12, 2025
b215af5
f
timotheeguerin Dec 12, 2025
cadc33f
abc
timotheeguerin Dec 12, 2025
397af47
try
timotheeguerin Dec 12, 2025
6d2b5df
rename
timotheeguerin Dec 12, 2025
32325fe
simplify
timotheeguerin Dec 12, 2025
6918fec
checkout self
timotheeguerin Dec 12, 2025
887af5a
optimize
timotheeguerin Dec 12, 2025
260371c
tweak condition
timotheeguerin Dec 12, 2025
ae1087a
.
timotheeguerin Dec 12, 2025
44d32fc
fox
timotheeguerin Dec 12, 2025
cf03ce8
tweaks
timotheeguerin Dec 12, 2025
fc2436d
.
timotheeguerin Dec 12, 2025
21e5ecf
f
timotheeguerin Dec 12, 2025
7f837bb
f
timotheeguerin Dec 12, 2025
092f325
abc
timotheeguerin Dec 12, 2025
b1bbc04
abc
timotheeguerin Dec 12, 2025
c4cf3a9
tweaks
timotheeguerin Dec 12, 2025
7731676
fix
timotheeguerin Dec 12, 2025
3d853c7
abc
timotheeguerin Dec 12, 2025
5ecd482
fix_
timotheeguerin Dec 12, 2025
eb66bce
test
timotheeguerin Dec 12, 2025
0842b64
abc
timotheeguerin Dec 12, 2025
72aaaab
test this
timotheeguerin Dec 12, 2025
a5a461b
this way
timotheeguerin Dec 12, 2025
a177070
tweaks
timotheeguerin Dec 15, 2025
f2b3da8
test
timotheeguerin Dec 17, 2025
2a06f18
test
timotheeguerin Dec 17, 2025
1d882f6
abc
timotheeguerin Dec 17, 2025
9a9dc75
test
timotheeguerin Dec 17, 2025
e838c93
progress
timotheeguerin Dec 17, 2025
379851e
abc
timotheeguerin Dec 17, 2025
01af002
test
timotheeguerin Dec 17, 2025
986601c
try this
timotheeguerin Dec 17, 2025
c692407
revert
timotheeguerin Dec 17, 2025
f0d08e8
abc
timotheeguerin Dec 17, 2025
3710baa
ignore cspell
timotheeguerin Dec 17, 2025
29447c4
Update eng/tsp-core/pipelines/jobs/publish-npm.yml
timotheeguerin Jan 6, 2026
b403129
Update eng/tsp-core/pipelines/jobs/create-github-release.yml
timotheeguerin Jan 6, 2026
e20efc7
Merge branch 'main' into esrp-publish
timotheeguerin Jan 7, 2026
e6dfb89
revert test
timotheeguerin Jan 7, 2026
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
26 changes: 21 additions & 5 deletions eng/tsp-core/pipelines/jobs/build-for-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
displayName: Test

- template: /eng/tsp-core/pipelines/templates/upload-coverage.yml

- script: pnpm chronus pack --exclude standalone --pack-destination $(Build.ArtifactStagingDirectory)/npm-packages-stable
displayName: Pack packages
- template: /eng/tsp-core/pipelines/templates/pack.yml
parameters:
artifactName: npm-packages-stable
name: npm_packages_stable

- task: CopyFiles@2
displayName: "Copy VSCode extension .vsix to artifact directory"
Expand All @@ -45,6 +46,16 @@ jobs:
scriptLocation: inlineScript
inlineScript: node ./eng/tsp-core/scripts/upload-bundler-packages.js

- task: AzureCLI@2
displayName: Upload scenario manifest
condition: eq(variables['PUBLISH_PKG_TYPESPEC_HTTP_SPECS'], 'true')
Comment thread
timotheeguerin marked this conversation as resolved.
inputs:
workingDirectory: packages/http-specs
azureSubscription: "TypeSpec Storage"
scriptType: "bash"
scriptLocation: "inlineScript"
inlineScript: "pnpm upload-manifest"

# Update version for next version publish
- script: node ./packages/internal-build-utils/cmd/cli.js bump-version-preview .
displayName: Bump version to prerelease targets
Expand All @@ -53,8 +64,10 @@ jobs:
displayName: Regen manifest for compiler
workingDirectory: ./packages/compiler

- script: pnpm chronus pack --exclude standalone --pack-destination $(Build.ArtifactStagingDirectory)/npm-packages-next
displayName: Pack next packages
- template: /eng/tsp-core/pipelines/templates/pack.yml
parameters:
artifactName: npm-packages-next
name: npm_packages_next

# Publish Next playground
- task: AzureCLI@1
Expand All @@ -72,6 +85,9 @@ jobs:
--overwrite

templateContext:
# Optimize so each output doesn't create its own scan
# https://eng.ms/docs/coreai/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs#multiple-outputs
outputParentDirectory: $(Build.ArtifactStagingDirectory)
outputs:
- output: pipelineArtifact
path: $(Build.ArtifactStagingDirectory)/npm-packages-stable
Expand Down
32 changes: 32 additions & 0 deletions eng/tsp-core/pipelines/jobs/create-github-release.yml
Comment thread
timotheeguerin marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
parameters:
- name: artifactName
type: string
- name: dependsOn
type: string
default: ""

jobs:
- job: build
Comment thread
timotheeguerin marked this conversation as resolved.
Outdated
dependsOn: ${{ parameters.dependsOn }}
displayName: Create github release(s)
pool:
name: azsdk-pool
image: ubuntu-24.04
os: linux

steps:
- download: current
artifact: ${{ parameters.artifactName }}
displayName: Download package manifest

- template: /eng/tsp-core/pipelines/templates/install.yml

- script: |
echo "Publish summary:"
cat "$(Pipeline.Workspace)/${{ parameters.artifactName }}/publish-summary.json"
displayName: Log publish summary

- script: pnpm chronus-github create-releases --repo microsoft/typespec --publish-summary "$(Pipeline.Workspace)/${{ parameters.artifactName }}/publish-summary.json"
displayName: Create github releases
env:
GITHUB_TOKEN: $(azuresdk-github-pat)
Comment thread
timotheeguerin marked this conversation as resolved.
95 changes: 33 additions & 62 deletions eng/tsp-core/pipelines/jobs/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,44 @@ parameters:
type: string
- name: tag
type: string
- name: publishGithubRelease
type: boolean
default: false
- name: condition
default: succeeded()
- name: dependsOn
type: string
default: ""

jobs:
- job: publish_npm_${{ parameters.tag }}
- deployment: publish_npm_${{ parameters.tag }}
displayName: Publish Npm (${{ parameters.tag }})
dependsOn: ${{ parameters.dependsOn }}
pool:
name: $(LINUXPOOL)
image: $(LINUXVMIMAGE)
condition: ${{ parameters.condition }}
environment: typespec-cli
Comment thread
timotheeguerin marked this conversation as resolved.
Outdated
pool: # hardcoding the pool and image name because deployment jobs do not support variable expansion in pool names
name: azsdk-pool
image: ubuntu-24.04
os: linux

steps:
- download: current
artifact: ${{ parameters.artifactName }}
displayName: Download Npm Packages

- template: ../templates/install.yml

- script: ls $(Pipeline.Workspace)/${{ parameters.artifactName }}
displayName: List files in artifact

- script: |
echo "Updating config"
pnpm config set '//registry.npmjs.org/:_authToken' '${NPM_AUTH_TOKEN}'
echo "Publishing at tag ${{ parameters.tag }}"
pnpm chronus publish "$(Pipeline.Workspace)/${{ parameters.artifactName }}/*.tgz" --tag ${{ parameters.tag }} --access public --engine npm --report-summary ./publish-summary.json
displayName: Publish
env:
NPM_AUTH_TOKEN: $(azure-sdk-npm-token)

- pwsh: |
$publishSummary = Get-Content "./publish-summary.json" | ConvertFrom-Json
if ($publishSummary.packages.'@typespec/http-specs'.published -eq $true) {
Write-Output "Setting PublishHttpSpecs variable to true."
Write-Host "##vso[task.setvariable variable=PublishHttpSpecs]true"
} else {
Write-Output "Setting PublishHttpSpecs variable to false."
Write-Host "##vso[task.setvariable variable=PublishHttpSpecs]false"
}
displayName: "Check if @typespec/http-specs was published"

- script: pnpm -r --filter '@typespec/http-specs...' build
condition: eq(variables['PublishHttpSpecs'], 'true')
displayName: Build spector

- task: AzureCLI@2
displayName: Upload scenario manifest
condition: eq(variables['PublishHttpSpecs'], 'true')
inputs:
workingDirectory: packages/http-specs
azureSubscription: "TypeSpec Storage"
scriptType: "bash"
scriptLocation: "inlineScript"
inlineScript: "pnpm upload-manifest"

- ${{ if eq(parameters.publishGithubRelease, true) }}:
- script: |
echo "Publish summary:"
cat ./publish-summary.json
displayName: Log publish summary

- script: pnpm chronus-github create-releases --repo microsoft/typespec --publish-summary ./publish-summary.json
displayName: Create github releases
env:
GITHUB_TOKEN: $(azuresdk-github-pat)
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: ${{ parameters.artifactName }}
itemPattern: "**/*.{tgz}"
targetPath: $(Pipeline.Workspace)/${{ parameters.artifactName }}/

strategy:
runOnce:
deploy:
steps:
- script: ls $(Pipeline.Workspace)/${{ parameters.artifactName }}
displayName: List files in artifact

# - template: /eng/tsp-core/pipelines/templates/release/esrp-release.yml
# parameters:
# tag: ${{ parameters.tag }}
# path: "$(Pipeline.Workspace)/${{ parameters.artifactName }}"

- script: |
echo "ESRP_RELEASE_DETAILS:"
echo "$ESRP_RELEASE_DETAILS"
Comment thread
timotheeguerin marked this conversation as resolved.
displayName: "Log ESRP release details"
41 changes: 18 additions & 23 deletions eng/tsp-core/pipelines/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ trigger:
- main
# For patch releases
- release/*
- esrp-publish # TODO: for test remove
Comment thread
timotheeguerin marked this conversation as resolved.
Outdated
paths:
exclude:
- packages/http-client-csharp
- packages/http-client-java
- packages/http-client-python

pr: none

Expand Down Expand Up @@ -46,17 +50,30 @@ extends:
os: linux

jobs:
- job: debug
variables:
varFromA: $[convertToJson(stageDependencies.build.outputs)]
deps: $[convertToJson(stageDependencies)] # create a variable with the job dependencies
steps:
- pwsh: Write-Host "$(deps)"

- template: /eng/tsp-core/pipelines/jobs/publish-npm.yml
parameters:
artifactName: npm-packages-stable
tag: latest
publishGithubRelease: true
condition: eq('true', stageDependencies.build.build.outputs['pack_npm_packages_stable.PUBLISH_PKG_ANY'])

- template: /eng/tsp-core/pipelines/jobs/publish-npm.yml
parameters:
dependsOn: publish_npm_latest
artifactName: npm-packages-next
tag: next
condition: eq('true', stageDependencies.build.build.outputs['pack_npm_packages_next.PUBLISH_PKG_ANY'])

- template: /eng/tsp-core/pipelines/jobs/create-github-release.yml
parameters:
dependsOn: publish_npm_latest
artifactName: npm-packages-stable

- stage: publish_vscode
displayName: Publish VSCode extension
Expand Down Expand Up @@ -99,25 +116,3 @@ extends:
displayName: "Build"
- script: docker push $(imageName) --all-tags
displayName: "Push"

- stage: validate_manifest
displayName: Validate Manifest
dependsOn: build
jobs:
- job: validate_manifest
displayName: Validate Manifest
pool:
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
variables:
TYPESPEC_SKIP_DOCUSAURUS_BUILD: true # Disable docusaurus build
steps:
- template: /eng/tsp-core/pipelines/templates/install.yml
- template: /eng/tsp-core/pipelines/templates/build.yml

- script: pnpm run validate-scenarios --debug
displayName: Validate Scenarios

- script: pnpm run validate-mock-apis --debug
displayName: Validate mock apis
19 changes: 19 additions & 0 deletions eng/tsp-core/pipelines/templates/pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Template installing all dependencies.
parameters:
- name: artifactName
type: string
- name: name
type: string

steps:
- pwsh: |
$outDir = "$(Build.ArtifactStagingDirectory)/${{ parameters.artifactName }}"
echo "Packing npm packages into $outDir"
pnpm chronus pack --exclude standalone --pack-destination $outDir

$summaryFilePath = "$outDir/publish-summary.json"
echo "Create manifest of unpublished packages in $summaryFilePath"

node eng/tsp-core/scripts/filter-unpublished-packages.ts "$outDir" --manifest $summaryFilePath
name: pack_${{ parameters.name }}
displayName: Pack packages ${{ parameters.artifactName }}
26 changes: 26 additions & 0 deletions eng/tsp-core/pipelines/templates/release/esrp-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
parameters:
- name: tag
type: string
default: stable
- name: path
type: string

steps:
- task: EsrpRelease@9
displayName: "Publish via ESRP"
condition: and(succeeded(), ne(variables['SkipPublishing'], 'true'))
inputs:
ConnectedServiceName: "Azure SDK PME Managed Identity"
ClientId: "5f81938c-2544-4f1f-9251-dd9de5b8a81b"
DomainTenantId: "975f013f-7f24-47e8-a7d3-abc4752bf346"
Usemanagedidentity: true
KeyVaultName: "kv-azuresdk-codesign"
SignCertName: "azure-sdk-esrp-release-certificate"
Intent: "PackageDistribution"
ContentType: "npm"
FolderLocation: ${{ parameters.path }}
Owners: ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
Approvers: ${{ coalesce(variables['Build.RequestedForEmail'], 'azuresdk@microsoft.com') }}
ServiceEndpointUrl: "https://api.esrp.microsoft.com"
MainPublisher: "ESRPRELPACMANTEST"
productstate: ${{ parameters.tag }}
Loading
Loading