C
C#8mo ago
Ikarmus

ADO YAML - output variables troubleshoot

Hi, I have pipeline, which compiles my app and publishes artifacts to azure, then I want to drop them to GitHub Releases. The problem is the necessity to use artifact names (due to compilation of android and windows app in the same pipeline) kinda like on provided image, ofc without debugs The problem is about exporting output variables (compilled artifact names) to other stages Compilation and Azure drop:
- publish: $(Build.SourcesDirectory)/SMCEBI_Navigator/bin
displayName: Publish full compiled app
artifact: '$(Build.BuildNumber)_${{ parameters.framework }}'

- pwsh: Write-Host "##vso[task.setvariable variable=outputArtifactName;isOutput=true]$(Build.BuildNumber)_${{ parameters.framework }}"
displayName: Export artifact name to pipeline

- pwsh: Write-Host $(properties.outputArtifactName)
displayName: Echo outputted name
- publish: $(Build.SourcesDirectory)/SMCEBI_Navigator/bin
displayName: Publish full compiled app
artifact: '$(Build.BuildNumber)_${{ parameters.framework }}'

- pwsh: Write-Host "##vso[task.setvariable variable=outputArtifactName;isOutput=true]$(Build.BuildNumber)_${{ parameters.framework }}"
displayName: Export artifact name to pipeline

- pwsh: Write-Host $(properties.outputArtifactName)
displayName: Echo outputted name
GitHub Release job:
- pwsh: Write-Host $(outputArtifactName)
displayName: Export artifact name to pipeline

- pwsh: Write-Host $(parameters.artifactName)
displayName: Parameters name

- download: current
displayName: Download artifact $(parameters.artifactName)
artifact: $(parameters.artifactName)

- task: GitHubRelease@1
inputs:
repositoryName: $(Build.Repository.Name)
target: $(Build.SourceVersion)
tagSource: userSpecifiedTag
tag: $(currentVersionName)
gitHubConnection: GitHub_ikarmus2001
action: create
assets: $(Pipeline.Workspace)
isDraft: true
- pwsh: Write-Host $(outputArtifactName)
displayName: Export artifact name to pipeline

- pwsh: Write-Host $(parameters.artifactName)
displayName: Parameters name

- download: current
displayName: Download artifact $(parameters.artifactName)
artifact: $(parameters.artifactName)

- task: GitHubRelease@1
inputs:
repositoryName: $(Build.Repository.Name)
target: $(Build.SourceVersion)
tagSource: userSpecifiedTag
tag: $(currentVersionName)
gitHubConnection: GitHub_ikarmus2001
action: create
assets: $(Pipeline.Workspace)
isDraft: true
Pipeline itself:
variables:
- name: WindowsArtifactName
value: ''

stages:
- template: templates/appCompilation.yml
parameters:
outputArtifactName: $(WindowsArtifactName)

- stage: Deployment
jobs:
- template: templates/GithubReleaseJob.yml
parameters:
artifactName: $[WindowsArtifactName]
variables:
- name: WindowsArtifactName
value: ''

stages:
- template: templates/appCompilation.yml
parameters:
outputArtifactName: $(WindowsArtifactName)

- stage: Deployment
jobs:
- template: templates/GithubReleaseJob.yml
parameters:
artifactName: $[WindowsArtifactName]
No description
4 Replies
Ikarmus
Ikarmus8mo ago
Both template jobs (compilation and github release) has parameters as follows:
parameters:
- name: artifactName
type: string
parameters:
- name: artifactName
type: string
parameters:
- name: outputArtifactName
type: string
parameters:
- name: outputArtifactName
type: string
Ikarmus
Ikarmus8mo ago
What am I doing wrong? I was reading some questions on stack, ms docs ( setvariable, Outputting variables ) , but can't figure out what is wrong here. If any more info is needed, I will be very happy to provide it
Stack Overflow
Azure Devops - passing variables between job templates
Normal (non-template) jobs in Azure DevOps yaml support inter-job variable passing as follows: jobs: - job: A steps: - script: "echo ##vso[task.setvariable variable=skipsubsequent;isOutput=true]
Define variables - Azure Pipelines
Variables are name-value pairs defined by you for use in a pipeline. You can use variables as inputs to tasks and in your scripts.
Logging commands - Azure Pipelines
How scripts can request work from the agent
Ikarmus
Ikarmus8mo ago
$help
MODiX
MODiX8mo ago
How to get the best help catpog Make a post in #help or one of the topic channels under Development. Avoid askingcatthinking Can anybody help catthinking Has anyone used catthinking Why doesn't my code work? C# is a big area! No one knows they can help unless you tell them about the small area you're trying to work in. Explain what you are doing, and potentially why for as much context as possible. Avoid screenshots where possible, share code directly in Discord. Type $code into chat to learn how to post code. See https://www.nohello.net and https://dontasktoask.com if you want common help chat room etiquette. Sorry, I couldn't find help related to "commands".
Want results from more Discord servers?
Add your server
More Posts
✅ I want to work on the ongoing ASP.NET project as free or minimum salary.Hi, Nice to meet you everyone. As a experienced Web and Blockchian developer, now I am trying to lea✅ embed images in outputhi, I'm looking for a way to embed an image in the output in such a way that it's data is readable. Making an interpreter read custom filename extensionsI made an interpreter in Visual Studio (C#) for my own language. My question is, how do I make it soASP.NET Core 8 Web API, can't use additional fields with Identity registrationHello, It's my first time using Identity, so I came across some issues. When I input json data neceusing serilog (c#) in a vb.netHello, I have an old application which is written in vb.net. I'm searching for a sollution to use s✅ Why is a variable false in project in WPF .Net application even after it should be true?Hi I'm currently building my first C# project and could really need some help, I'm supposed to take i need help because i dont why this is nullif u need smt (sql or smt ab my visual code lmk please)Is there a way to ensure a function can't modify a parameter?I often want to pass objects or values into a function, and make sure the function cannot change it.why is my handler not working, also the breakpoint doesn't even get hit for it[ValidateAntiForgeryToken] public IActionResult OnPostPlaceOrder() { tryWinForms Course Registration/Validation HomeworkI just started my C# class for college and I've been having a real tough time trying to get my WinFo