Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DotNetFinalVersionKind variable in yml #170

Merged
merged 11 commits into from
Nov 14, 2024

Conversation

carlossanlop
Copy link
Member

No description provided.

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try it.

@carlossanlop
Copy link
Member Author

Didn't work in the internal test run.

@carlossanlop carlossanlop marked this pull request as draft November 12, 2024 18:41
@ericstj
Copy link
Member

ericstj commented Nov 13, 2024

Per offline discussion we should try to make this work with https://learn.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script#use-parameters-in-pipelines

@carlossanlop
Copy link
Member Author

There are 3 possible values according to the docs:

  • ""
  • prerelease
  • release

I switched to trying using parameters: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/runtime-parameters?view=azure-devops&tabs=script

Here's a job testing it: https://dev.azure.com/dnceng/internal/_build/results?buildId=2581675&view=logs&s=6884a131-87da-5381-61f3-d7acc3b91d76

Here's how setting the parameter looks like:

image

It's taking forever to run, so I'll check tomorrow.

@carlossanlop
Copy link
Member Author

It's working!

Script contents: shell
eng\common\cibuild.cmd -configuration Release -prepareMachine /p:Test=false /p:DotNetFinalVersionKind=prerelease /p:Test=false /p:DotNetSignType=real /p:TeamName=dotnet-core /p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=20241113.5

@carlossanlop carlossanlop marked this pull request as ready for review November 14, 2024 04:54
@ViktorHofer
Copy link
Member

Can I supply an empty value as well?

@carlossanlop
Copy link
Member Author

Can I supply an empty value as well?

Sure, go ahead. I tried this and didn't work: 0dd40ce

And if you can make it default, even better.

@ViktorHofer
Copy link
Member

What about adding a "none" option that in YML then gets set to ''?

@carlossanlop
Copy link
Member Author

I tried with "none" but it's passed as the literal string "none", instead of getting converted to ''. It didn't work:

eng\common\cibuild.cmd -configuration Release -prepareMachine /p:Test=false /p:DotNetFinalVersionKind=none /p:Test=false /p:DotNetSignType=real /p:TeamName=dotnet-core /p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=20241114.1

So I added a condition that selects the value of the _DotNetFinalVersionKind variable depending on the value of the parameter. It worked!

eng\common\cibuild.cmd -configuration Release -prepareMachine /p:Test=false  /p:Test=false /p:DotNetSignType=real /p:TeamName=dotnet-core /p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=20241114.2

@carlossanlop carlossanlop merged commit 9007f15 into dotnet:main Nov 14, 2024
5 checks passed
@carlossanlop carlossanlop deleted the FixYml branch November 14, 2024 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants