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 OC version used in templates #12757

Merged
merged 1 commit into from Nov 3, 2022
Merged

Fix OC version used in templates #12757

merged 1 commit into from Nov 3, 2022

Conversation

sebastienros
Copy link
Member

The template default settings are generated on build. These templates have an OrchardVersion argument that has a default value defined in an msbuild script to be replaced with the Version property. In the release pipeline this value will have the VersionSuffix applied to it, like preview.

This PR forces the value of the version property to be the one in the tag which will prevent preview from being added. This will also fix the templates' default value for OrchardVersion.

The pack command uses the Version property only for the packages, and at that point the templates json files are already built with the wrong version.

The template default settings are generated on build. These templates have an `OrchardVersion` argument that has a default value defined in an msbuild script to be replaced with the `Version` property. In the release pipeline this value will have the `VersionSuffix` applied to it, like `preview`. 

This PR forces the value of the version property to be the one in the tag which will prevent `preview` from being added. This will also fix the templates' default value for `OrchardVersion`.

The `pack` command uses the `Version` property only for the packages, and at that point the templates json files are already built with the wrong version.
@sebastienros
Copy link
Member Author

@ns8482e this is the issue you mentioned this morning and that I was able to reproduce.
Another option would be to remove the <VersionSuffix> value when we ship and put it back after. This is probably something we have forgotten for some releases. With this solution we don't have to change it. Like we don't have to change the <VersionPrefix> either.

@ns8482e
Copy link
Contributor

ns8482e commented Nov 3, 2022

@sebastienros this how I have in my modules

<VersionPrefix>1.5</VersionPrefix>
 <VersionSuffix Condition="'$(GraduatePackage)'!='true'">preview</VersionSuffix>
 <VersionSuffix Condition="'$(VersionSuffix)'!='' AND '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>

and in ADO

 - task: DotNetCoreCLI@2
        displayName: "Build OCCMS .net 6.0" 
        inputs:
          command: 'build'
          projects: '$(Agent.BuildDirectory)/code/occms/occms.sln'
          arguments: '--configuration $(buildConfiguration) --no-restore --framework net6.0'
          buildProperties: 'BuildNumber="$(buildNumber)";GraduatePackage="$(GraduatePackage)"'

So when I change GraduatePackage variable to true it will create release build otherwise preview

@sebastienros sebastienros merged commit 728ddb2 into main Nov 3, 2022
@sebastienros sebastienros deleted the sebros/templates branch November 3, 2022 21:44
@jtkech
Copy link
Member

jtkech commented Nov 4, 2022

Too late but LGTM ;)

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.

None yet

3 participants