Skip to content

Commit

Permalink
Added changes to release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisNikulin5 committed Sep 4, 2024
1 parent 2bbe707 commit 6ab68ac
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 16 deletions.
18 changes: 12 additions & 6 deletions .azure-pipelines/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ parameters:
- name: container
type: string

- name: targetFramework
type: string

- name: timeoutInMinutes
type: number

Expand Down Expand Up @@ -78,12 +81,13 @@ jobs:
displayName: ${{ parameters.displayName }}
pool: ${{ parameters.pool }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
strategy:
matrix:
NET6.0:
targetFramework: 'net6.0'
NET8.0:
targetFramework: 'net8.0'
${{ if eq(parameters.targetFramework, 'all') }}:
strategy:
matrix:
NET6.0:
targetFramework: 'net6.0'
NET8.0:
targetFramework: 'net8.0'


${{ if ne(parameters.container, '') }}:
Expand All @@ -107,6 +111,8 @@ jobs:
DisableDockerDetector: true
nugetMultiFeedWarnLevel: none
CheckoutBranch: ${{ parameters.branch }}
${{ if ne(parameters.targetFramework, 'all') }}:
targetFramework: ${{ parameters.targetFramework }}
templateContext:
outputs:
- ${{ if or(parameters.unitTests, parameters.functionalTests) }}:
Expand Down
8 changes: 7 additions & 1 deletion .azure-pipelines/build-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ parameters:
type: string
default: ''

- name: targetFramework
type: string
default: 'all'

- name: timeoutInMinutes
type: number
default: 120
Expand Down Expand Up @@ -81,6 +85,7 @@ jobs:
verifySigning: ${{ parameters.verifySigning }}
publishArtifact: ${{ parameters.publishArtifacts }}
packageType: agent
targetFramework: ${{ parameters.targetFramework }}

- ${{ if parameters.buildAlternatePackage }}:
- template: /.azure-pipelines/build-job.yml@self
Expand All @@ -99,4 +104,5 @@ jobs:
sign: ${{ parameters.sign }}
verifySigning: ${{ parameters.verifySigning }}
publishArtifact: ${{ parameters.publishArtifacts }}
packageType: pipelines-agent
packageType: pipelines-agent
targetFramework: ${{ parameters.targetFramework }}
31 changes: 25 additions & 6 deletions .azure-pipelines/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool.
# This pipeline will be extended to the OneESPT template
parameters:
- name: targetFramework
type: string
default: all
values:
- all
- net6.0
- net8.0
- name: preBuildStages
type: stageList
default: []
Expand Down Expand Up @@ -102,19 +109,22 @@ extends:
- ${{ if parameters.testProxyAgent }}:
- job: test_proxy_agent
displayName: Test Proxy Agent
strategy:
matrix:
NET6.0:
targetFramework: 'net6.0'
NET8.0:
targetFramework: 'net8.0'
${{ if eq(parameters.targetFramework, 'all') }}:
strategy:
matrix:
NET6.0:
targetFramework: 'net6.0'
NET8.0:
targetFramework: 'net8.0'
pool:
name: 1ES-ABTT-Shared-Pool
image: abtt-ubuntu-2204
os: linux
variables:
DisableDockerDetector: true
nugetMultiFeedWarnLevel: none
${{ if ne(parameters.targetFramework, 'all') }}:
targetFramework: ${{ parameters.targetFramework }}
timeoutInMinutes: 300
steps:
- template: /.azure-pipelines/get-pat.yml@self
Expand Down Expand Up @@ -155,6 +165,7 @@ extends:
verifySigning: ${{ parameters.sign }}
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}

# Windows (x86)
- ${{ if parameters.win_x86 }}:
Expand All @@ -174,6 +185,7 @@ extends:
sign: ${{ parameters.sign }}
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}

# Linux (x64)
- ${{ if parameters.linux_x64 }}:
Expand All @@ -193,6 +205,7 @@ extends:
sign: ${{ parameters.sign }}
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}

# Linux (ARM)
- ${{ if parameters.linux_arm }}:
Expand All @@ -213,6 +226,7 @@ extends:
sign: false
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}

# Linux (ARM64)
- ${{ if parameters.linux_arm64 }}:
Expand All @@ -233,6 +247,7 @@ extends:
sign: false
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}

# Alpine (x64)
- ${{ if parameters.alpine_x64 }}:
Expand All @@ -253,6 +268,7 @@ extends:
sign: false
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: false
targetFramework: ${{ parameters.targetFramework }}

# Alpine (ARM64)
- ${{ if parameters.alpine_arm64 }}:
Expand All @@ -273,6 +289,7 @@ extends:
sign: false
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: false
targetFramework: ${{ parameters.targetFramework }}

# macOS (x64)
- ${{ if parameters.macOS_x64 }}:
Expand All @@ -293,6 +310,7 @@ extends:
sign: ${{ parameters.sign }}
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}

# macOS (ARM64)
- ${{ if parameters.macOS_arm64 }}:
Expand All @@ -313,4 +331,5 @@ extends:
sign: ${{ parameters.sign }}
publishArtifacts: ${{ parameters.publishArtifacts }}
buildAlternatePackage: ${{ parameters.buildAlternatePackage }}
targetFramework: ${{ parameters.targetFramework }}
- ${{ parameters.postBuildStages }}
15 changes: 15 additions & 0 deletions .vsts.release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ parameters:
type: string
displayName: Version
default: 'NotSet'
- name: targetFramework
displayName: Target framework
type: string
default: net6.0
values:
- net6.0
- net8.0
- name: derivedFrom
type: string
displayName: Derived From Version
Expand Down Expand Up @@ -73,6 +80,7 @@ extends:
test: ${{ not(parameters.skipTests) }}
sign: true
publishArtifacts: true
targetFramework: ${{ parameters.targetFramework }}
testProxyAgent: ${{ parameters.testProxyAgent }}
stageDependencies:
- Verify_release
Expand Down Expand Up @@ -138,6 +146,13 @@ extends:
if ($agentVersion -eq 'NotSet') {
Write-Error "Version parameter is required for manual release." -ErrorAction Stop
}
## Verify target framework for specified version
$majorVersion = $agentVersion.Split('.')[0]
if (${{ parameters.targetFramework }} -eq "net6.0" -and $majorVersion -ne "3") -or
(${{ parameters.targetFramework }} -eq "net8.0" -and $majorVersion -ne "4") {
Write-Error "The major version should be 3 for net6.0 and 4 for net8.0" -ErrorAction Stop
}
}
if ($isTestRun) {
$agentVersion = '3.000.999'
Expand Down
6 changes: 3 additions & 3 deletions src/dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ set -eo pipefail
# .NET version for agent build.
NET_VERSIONS="
net6.0-sdk=6.0.424
net6.0-runtime=6.0.32
net6.0-runtime=6.0.32
net8.0-sdk=8.0.401
net8.0-runtime=8.0.8"
net8.0-sdk=8.0.401
net8.0-runtime=8.0.8"

ALL_ARGS=("$@")
DEV_CMD=$1
Expand Down

0 comments on commit 6ab68ac

Please sign in to comment.