Skip to content

Commit e521230

Browse files
authored
Merge pull request #2005 from microsoft/ci/updates-to-main
ci: updates main with the latest ci changes
2 parents df5d0c7 + 1ae06b1 commit e521230

File tree

3 files changed

+39
-49
lines changed

3 files changed

+39
-49
lines changed

.azure-pipelines/ci-build.yml

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
55
trigger:
66
branches:
77
include:
8-
- master
9-
- vnext
8+
- main
9+
- dev
10+
- support/v1
1011
pr:
1112
branches:
1213
include:
13-
- master
14-
- vnext
14+
- main
15+
- dev
16+
- support/v1
1517
variables:
1618
buildPlatform: 'Any CPU'
1719
buildConfiguration: 'Release'
@@ -41,10 +43,6 @@ extends:
4143
displayName: 'Publish Artifact: Nugets'
4244
artifactName: Nugets
4345
targetPath: '$(Build.ArtifactStagingDirectory)/Nugets'
44-
- output: pipelineArtifact
45-
displayName: 'Publish Artifact: Hidi'
46-
artifactName: Microsoft.OpenApi.Hidi-v$(hidiversion)
47-
targetPath: '$(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi-v$(hidiversion)'
4846
steps:
4947
- task: UseDotNet@2
5048
displayName: 'Use .NET 6'
@@ -177,23 +175,13 @@ extends:
177175
MaxConcurrency: '50'
178176
MaxRetryAttempts: '5'
179177
PendingAnalysisWaitTimeoutMinutes: '5'
180-
181-
- task: PowerShell@2
182-
displayName: "Get Hidi's version-number from .csproj"
183-
inputs:
184-
targetType: 'inline'
185-
script: |
186-
$xml = [Xml] (Get-Content .\src\Microsoft.OpenApi.Hidi\Microsoft.OpenApi.Hidi.csproj)
187-
$version = $xml.Project.PropertyGroup.Version
188-
echo $version
189-
echo "##vso[task.setvariable variable=hidiversion]$version"
190-
178+
191179
# publish hidi as an .exe
192180
- task: DotNetCoreCLI@2
193181
displayName: publish Hidi as executable
194182
inputs:
195183
command: 'publish'
196-
arguments: -c Release --runtime win-x64 /p:PublishSingleFile=true /p:PackAsTool=false --self-contained --output $(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi-v$(hidiversion)
184+
arguments: -c Release --runtime win-x64 /p:PublishSingleFile=true /p:PackAsTool=false --self-contained --output $(Build.ArtifactStagingDirectory)/Microsoft.OpenApi.Hidi
197185
projects: 'src/Microsoft.OpenApi.Hidi/Microsoft.OpenApi.Hidi.csproj'
198186
publishWebProjects: False
199187
zipAfterPublish: false
@@ -206,10 +194,17 @@ extends:
206194
content: '*.nupkg'
207195

208196
- stage: deploy
209-
condition: and(contains(variables['build.sourceBranch'], 'refs/heads/master'), succeeded())
197+
condition: and(or(contains(variables['build.sourceBranch'], 'refs/heads/main'),contains(variables['build.sourceBranch'], 'refs/heads/support/v1')), succeeded())
210198
dependsOn: build
211199
jobs:
212200
- deployment: deploy_hidi
201+
templateContext:
202+
type: releaseJob
203+
isProduction: true
204+
inputs:
205+
- input: pipelineArtifact
206+
artifactName: Nugets
207+
targetPath: '$(Pipeline.Workspace)'
213208
dependsOn: []
214209
environment: nuget-org
215210
strategy:
@@ -218,15 +213,6 @@ extends:
218213
pool:
219214
vmImage: ubuntu-latest
220215
steps:
221-
- task: DownloadPipelineArtifact@2
222-
displayName: Download nupkg from artifacts
223-
inputs:
224-
artifact: Nugets
225-
source: current
226-
- task: DownloadPipelineArtifact@2
227-
displayName: Download hidi executable from artifacts
228-
inputs:
229-
source: current
230216
- pwsh: |
231217
$artifactName = Get-ChildItem -Path $(Pipeline.Workspace)\Nugets -Filter Microsoft.OpenApi.*.nupkg -recurse | select -First 1
232218
$artifactVersion= $artifactName.Name -replace "Microsoft.OpenApi.", "" -replace ".nupkg", ""
@@ -264,6 +250,13 @@ extends:
264250
]'
265251

266252
- deployment: deploy_lib
253+
templateContext:
254+
type: releaseJob
255+
isProduction: true
256+
inputs:
257+
- input: pipelineArtifact
258+
artifactName: Nugets
259+
targetPath: '$(Pipeline.Workspace)'
267260
dependsOn: []
268261
environment: nuget-org
269262
strategy:
@@ -272,11 +265,6 @@ extends:
272265
pool:
273266
vmImage: ubuntu-latest
274267
steps:
275-
- task: DownloadPipelineArtifact@2
276-
displayName: Download nupkg from artifacts
277-
inputs:
278-
artifact: Nugets
279-
source: current
280268
- powershell: |
281269
$fileNames = "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Hidi.*.nupkg", "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Readers.*.nupkg", "$(Pipeline.Workspace)/Nugets/Microsoft.OpenApi.Workbench.*.nupkg"
282270
foreach($fileName in $fileNames) {
@@ -294,6 +282,13 @@ extends:
294282
publishFeedCredentials: 'OpenAPI Nuget Connection'
295283

296284
- deployment: deploy_readers
285+
templateContext:
286+
type: releaseJob
287+
isProduction: true
288+
inputs:
289+
- input: pipelineArtifact
290+
artifactName: Nugets
291+
targetPath: '$(Pipeline.Workspace)'
297292
dependsOn: deploy_lib
298293
environment: nuget-org
299294
strategy:
@@ -302,11 +297,6 @@ extends:
302297
pool:
303298
vmImage: ubuntu-latest
304299
steps:
305-
- task: DownloadPipelineArtifact@2
306-
displayName: Download nupkg from artifacts
307-
inputs:
308-
artifact: Nugets
309-
source: current
310300
- task: 1ES.PublishNuget@1
311301
displayName: 'NuGet push'
312302
inputs:

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: CodeQL Analysis
22

33
on:
44
push:
5-
branches: [ vnext ]
5+
branches: [ main, dev ]
66
pull_request:
77
schedule:
88
- cron: '0 8 * * *'

.github/workflows/docker.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Publish Docker image
22
on:
33
workflow_dispatch:
44
push:
5-
branches: [master, vnext]
5+
branches: [main, dev, support/v1]
66
paths: ['src/Microsoft.OpenApi.Hidi/**', '.github/workflows/**']
77
env:
88
REGISTRY: msgraphprod.azurecr.io
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- name: Check out the repo
1818
uses: actions/checkout@v4
19-
- name: Login to GitHub package feed
19+
- name: Login to registry
2020
uses: docker/[email protected]
2121
with:
2222
username: ${{ secrets.ACR_USERNAME }}
@@ -28,15 +28,15 @@ jobs:
2828
echo "::set-output name=version::${version}"
2929
shell: pwsh
3030
id: getversion
31-
- name: Push to GitHub Packages - Nightly
32-
if: ${{ github.ref == 'refs/heads/vnext' }}
33-
uses: docker/build-push-action@v6.9.0
31+
- name: Push to registry - Nightly
32+
if: ${{ github.ref == 'refs/heads/dev' }}
33+
uses: docker/build-push-action@v6.10.0
3434
with:
3535
push: true
3636
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly
37-
- name: Push to GitHub Packages - Release
38-
if: ${{ github.ref == 'refs/heads/master' }}
39-
uses: docker/build-push-action@v6.9.0
37+
- name: Push to registry - Release
38+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/support/v1' }}
39+
uses: docker/build-push-action@v6.10.0
4040
with:
4141
push: true
4242
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.getversion.outputs.version }}

0 commit comments

Comments
 (0)