Skip to content

Commit c36172e

Browse files
committed
fix: Append job attempt number to artifact names in build stage to allow retrying jobs.
1 parent 2109f17 commit c36172e

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Prefix your items with `(Template)` if the change is about the template and not
1010
- Removed all references to Uno.SourceGenerationTasks packages and adjusted the dependency injection recipe in ViewModels accordingly.
1111
- Fix Android bottom screen space.
1212
- Fix yaml configuration for tests to always publish test results.
13+
- Append job attempt number to artifact names in build stage to allow retrying jobs.
1314

1415
## 3.10.X
1516
- Added Dependency Injection validation in the development environment.

‎build/stage-build.yml‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ jobs:
4747
pool:
4848
vmImage : $(windowsHostedAgentImage)
4949
variables:
50-
ArtifactName: ReleaseNotes_${{ parameters.applicationEnvironment }}
51-
ApplicationEnvironment: ${{ parameters.applicationEnvironment }}
50+
- name: ArtifactName
51+
# Appending attempt number to artifact name in case of retries (e.g. Attempt 1: ReleaseNotes_Production, Attempt 2: ReleaseNotes_Production_Attempt2).
52+
value: $[ format('ReleaseNotes_{0}{1}', '${{ parameters.applicationEnvironment }}', replace(format('_Attempt{0}', variables['System.JobAttempt']), '_Attempt1', '')) ]
53+
- name: ApplicationEnvironment
54+
value: ${{ parameters.applicationEnvironment }}
5255
steps:
5356
- template: steps-build-release-notes.yml
5457
parameters:
@@ -64,7 +67,7 @@ jobs:
6467
- name: ApplicationPlatform
6568
value: x64
6669
- name: ArtifactName
67-
value: $(WindowsArtifactName)_${{ parameters.applicationEnvironment }}
70+
value: $[ format('{0}_{1}{2}', variables['WindowsArtifactName'], '${{ parameters.applicationEnvironment }}', replace(format('_Attempt{0}', variables['System.JobAttempt']), '_Attempt1', '')) ]
6871
- name: ApplicationEnvironment
6972
value: ${{ parameters.applicationEnvironment }}
7073
- name: BuildTargetFramework
@@ -87,12 +90,14 @@ jobs:
8790
pool:
8891
vmImage : $(windowsHostedAgentImage)
8992
variables:
90-
ArtifactName: $(TestsArtifactName)_${{ parameters.applicationEnvironment }}
91-
ApplicationEnvironment: ${{ parameters.applicationEnvironment }}
93+
- name: ArtifactName
94+
value: ReleaseNotes_${{ parameters.applicationEnvironment }}_Attempt$(System.JobAttempt)
95+
- name: ApplicationEnvironment
96+
value: ${{ parameters.applicationEnvironment }}
9297
steps:
9398
- template: steps-build-tests.yml
9499
parameters:
95-
pathToSrc: ${{ parameters.pathToSrc }}
100+
pathToSrc: ${{ parameters.pathToSrc }}wrongPath
96101
solutionFileName: '${{ parameters.solutionName }}.sln'
97102
solutionName: ${{ parameters.solutionName }}
98103

@@ -103,7 +108,7 @@ jobs:
103108
- name: ApplicationEnvironment
104109
value: ${{ parameters.applicationEnvironment }}
105110
- name: ArtifactName
106-
value: $(AndroidArtifactName)_${{ parameters.applicationEnvironment }}
111+
value: $[ format('{0}_{1}{2}', variables['AndroidArtifactName'], '${{ parameters.applicationEnvironment }}', replace(format('_Attempt{0}', variables['System.JobAttempt']), '_Attempt1', '')) ]
107112
- name: ApplicationPlatform
108113
value: AnyCPU
109114
- name: BuildTargetFramework
@@ -135,7 +140,7 @@ jobs:
135140
- name: BuildTargetFramework
136141
value: net9.0-ios
137142
- name: ArtifactName
138-
value: $(iOSArtifactName)_${{ parameters.applicationEnvironment }}
143+
value: $[ format('{0}_{1}{2}', variables['iOSArtifactName'], '${{ parameters.applicationEnvironment }}', replace(format('_Attempt{0}', variables['System.JobAttempt']), '_Attempt1', '')) ]
139144

140145
# For optimization, if we are on light build, we only build the project else we publish it.
141146
- name: dotNetCommand

0 commit comments

Comments
 (0)