Skip to content

Publish artifacts in deploy box #365

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 2 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .pipelines/Package-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ extends:
Network: KS3
WindowsHostVersion:
Version: 2022
# Azure container/blob operations get blocked when using KS3
Network: KS2
Network: KS3
Copy link
Member

Choose a reason for hiding this comment

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

really should be R1 but can be in a future PR

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, will change to use R1 in a separate PR. Opened #367 to track.

globalSdl:
disableLegacyManifest: true
# disabled Armorty as we dont have any ARM templates to scan. It fails on some sample ARM templates.
Expand Down
19 changes: 15 additions & 4 deletions .pipelines/Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: 'Enable debug output'
type: boolean
default: false
- name: 'publish'
displayName: 'Publish artifacts'
type: boolean
default: true

variables:
- name: CDP_DEFINITION_BUILD_COUNT
Expand Down Expand Up @@ -36,15 +40,16 @@ resources:
extends:
template: v2/OneBranch.Official.CrossPlat.yml@templates
parameters:
release:
category: NonAzure
cloudvault:
enabled: false
featureFlags:
LinuxHostVersion:
Network: KS3
WindowsHostVersion:
Version: 2022
# Azure container/blob operations get blocked when using KS3
Network: KS2
Network: KS3
globalSdl:
asyncSdl:
enabled: true
Expand Down Expand Up @@ -108,22 +113,28 @@ extends:
dependsOn: UpdateChangeLog
jobs:
- template: /.pipelines/templates/release-publish-github.yml@self
parameters:
publish: ${{ parameters.publish }}

- stage: PublishNuGet
displayName: Publish NuGet
dependsOn: PublishGitHubRelease
variables:
ob_release_environment: Production
jobs:
- template: /.pipelines/templates/release-publish-nuget.yml@self
parameters:
publish: true
publish: ${{ parameters.publish }}

- stage: PublishModule
displayName: Publish Module
dependsOn: PublishGitHubRelease
variables:
ob_release_environment: Production
jobs:
- template: /.pipelines/templates/release-publish-module.yml@self
parameters:
publish: true
publish: ${{ parameters.publish }}

- stage: PublishMsix
dependsOn: PublishGitHubRelease
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/module-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- group: DotNetPrivateBuildAccess
- group: certificate_logical_to_actual
- name: ob_sdl_sbom_enabled
value: false
value: true
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: repoRoot
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/templates/nupkg-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- group: mscodehub-feed-read-akv
- group: DotNetPrivateBuildAccess
- name: ob_sdl_sbom_enabled
value: false
value: true
- name: ob_sdl_codeql_compiled_enabled
value: false

Expand Down
6 changes: 6 additions & 0 deletions .pipelines/templates/release-publish-github.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
parameters:
- name: publish
default: false
type: boolean

jobs:
- job: GithubReleaseDraft
displayName: Create GitHub Release Draft
Expand Down Expand Up @@ -84,6 +89,7 @@ jobs:
$description = '<!-- TODO: Generate release notes on GitHub! -->'
Publish-ReleaseDraft -Tag $releaseTag -Name "$releaseTag Release of AIShell" -Description $description -User PowerShell -Repository AIShell -PackageFolder $(PackagesRoot) -Token $(GitHubReleasePat)
displayName: Publish Release Draft
condition: and(ne('${{ parameters.publish }}', 'false'), succeeded())

- template: /.pipelines/templates/wait-for-approval.yml@self
parameters:
Expand Down
25 changes: 14 additions & 11 deletions .pipelines/templates/release-publish-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,36 @@ parameters:
jobs:
- job: ModulePublish
displayName: Publish to PSGallery
pool:
type: release
os: windows
templateContext:
inputs:
- input: pipelineArtifact
pipeline: AIShellPackagePipeline
artifactName: drop_module_package
variables:
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
# Disable SBOM, signing, and codeQL for this job
- name: ob_sdl_sbom_enabled
value: false
- name: ob_signing_setup_enabled
value: false
- name: ob_sdl_codeql_compiled_enabled
value: false
pool:
type: windows

steps:
- download: AIShellPackagePipeline
artifact: drop_module_package
displayName: Download module package

- pwsh: |
Get-ChildItem '$(Pipeline.Workspace)/AIShellPackagePipeline/drop_module_package/*.nupkg' -recurse
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Get-ChildItem '$(Pipeline.Workspace)/*.nupkg' -recurse
displayName: List nupkg package

- task: NuGetCommand@2
displayName: Push AIShell module to PSGallery feed
condition: and(ne('${{ parameters.publish }}', 'false'), succeeded())
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/AIShellPackagePipeline/drop_module_package/*.nupkg'
packagesToPush: '$(Pipeline.Workspace)/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: PowerShellGallery-dongbow
31 changes: 20 additions & 11 deletions .pipelines/templates/release-publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,35 @@ jobs:
displayName: Publish to NuGet
condition: succeeded()
pool:
type: windows
type: release
os: windows
templateContext:
inputs:
- input: pipelineArtifact
pipeline: AIShellPackagePipeline
artifactName: drop_nupkg_package
variables:
- group: 'mscodehub-code-read-akv'
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
# Disable SBOM, signing, and codeQL for this job
- name: ob_sdl_sbom_enabled
value: false
- name: ob_signing_setup_enabled
value: false
- name: ob_sdl_codeql_compiled_enabled
value: false

steps:
- download: AIShellPackagePipeline
artifact: drop_nupkg_package
displayName: Download nuget packages

- pwsh: |
Get-ChildItem '$(Pipeline.Workspace)/AIShellPackagePipeline/drop_nupkg_package/*.nupkg' -recurse
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
Get-ChildItem '$(Pipeline.Workspace)/*.nupkg' -recurse
displayName: List nupkg package

- task: NuGetCommand@2
displayName: 'NuGet push'
condition: and(ne('${{ parameters.publish }}', 'false'), succeeded())
inputs:
command: push
packagesToPush: '$(Pipeline.Workspace)/AIShellPackagePipeline/drop_nupkg_package/*.nupkg'
packagesToPush: '$(Pipeline.Workspace)/*.nupkg'
nuGetFeedType: external
publishFeedCredentials: PowerShellNuGetOrgPush