Skip to content

Commit

Permalink
ci: updates pipelines with latest definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Dec 19, 2024
1 parent 9ff9789 commit 5b2b951
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 29 deletions.
48 changes: 28 additions & 20 deletions .azure-pipelines/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
branches:
include:
- master
- vnext
- main
- dev
- support/v1
pr:
branches:
include:
- master
- vnext
- main
- dev
- support/v1
variables:
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
Expand Down Expand Up @@ -206,10 +208,17 @@ extends:
content: '*.nupkg'

- stage: deploy
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded())
condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'),contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded())
dependsOn: build
jobs:
- deployment: deploy_hidi
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: Nugets
targetPath: '$(Pipeline.Workspace)'
dependsOn: []
environment: nuget-org
strategy:
Expand All @@ -218,11 +227,6 @@ extends:
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nupkg from artifacts
inputs:
artifact: Nugets
source: current
- task: DownloadPipelineArtifact@2
displayName: Download hidi executable from artifacts
inputs:
Expand Down Expand Up @@ -264,6 +268,13 @@ extends:
]'

- deployment: deploy_lib
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: Nugets
targetPath: '$(Pipeline.Workspace)'
dependsOn: []
environment: nuget-org
strategy:
Expand All @@ -272,11 +283,6 @@ extends:
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nupkg from artifacts
inputs:
artifact: Nugets
source: current
- powershell: |
$fileNames = "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Readers.*.nupkg", "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Workbench.*.nupkg"
foreach($fileName in $fileNames) {
Expand All @@ -294,6 +300,13 @@ extends:
publishFeedCredentials: 'OpenAPI Nuget Connection'

- deployment: deploy_readers
templateContext:
type: releaseJob
isProduction: true
inputs:
- input: pipelineArtifact
artifactName: Nugets
targetPath: '$(Pipeline.Workspace)'
dependsOn: deploy_lib
environment: nuget-org
strategy:
Expand All @@ -302,11 +315,6 @@ extends:
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@2
displayName: Download nupkg from artifacts
inputs:
artifact: Nugets
source: current
- task: 1ES.PublishNuget@1
displayName: 'NuGet push'
inputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CodeQL Analysis

on:
push:
branches: [ vnext ]
branches: [ main, dev ]
pull_request:
schedule:
- cron: '0 8 * * *'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish Docker image
on:
workflow_dispatch:
push:
branches: [master, vnext]
branches: [main, dev, support/v1]
paths: ['src/Microsoft.OpenApi.Hidi/**', '.github/workflows/**']
env:
REGISTRY: msgraphprod.azurecr.io
Expand All @@ -16,7 +16,7 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Login to GitHub package feed
- name: Login to registry
uses: docker/[email protected]
with:
username: ${{ secrets.ACR_USERNAME }}
Expand All @@ -28,15 +28,15 @@ jobs:
echo "::set-output name=version::${version}"
shell: pwsh
id: getversion
- name: Push to GitHub Packages - Nightly
if: ${{ github.ref == 'refs/heads/vnext' }}
uses: docker/build-push-action@v6.7.0
- name: Push to registry - Nightly
if: ${{ github.ref == 'refs/heads/dev' }}
uses: docker/build-push-action@v6.10.0
with:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
- name: Push to GitHub Packages - Release
if: ${{ github.ref == 'refs/heads/master' }}
uses: docker/build-push-action@v6.7.0
- name: Push to registry - Release
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/support/v1' }}
uses: docker/build-push-action@v6.10.0
with:
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}

0 comments on commit 5b2b951

Please sign in to comment.