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

Topic/story 30008 tag publishing and version bumping #22

Merged
merged 22 commits into from
Apr 1, 2022

Conversation

aweneer
Copy link
Contributor

@aweneer aweneer commented Mar 29, 2022

No description provided.

@aweneer aweneer requested review from gfraiteur and prochan2 March 29, 2022 14:17
@aweneer aweneer self-assigned this Mar 29, 2022
return true;
}

private static bool TagLastCommit( BuildContext context, Version? version, string? packageVersionSuffix )
Copy link
Member

Choose a reason for hiding this comment

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

Rename to AddTagToLastCommit


if ( lastVersion > currentVersion )
{
context.Console.WriteError( $"Last tag version '{lastVersion}' is bigger than current version '{currentVersion}'" );
Copy link
Member

Choose a reason for hiding this comment

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

.

versionNumber = lastVersionTag.Substring( 0, lastVersionTag.IndexOf( '-', StringComparison.InvariantCulture ) );
}

var lastVersion = new Version( versionNumber );
Copy link
Member

Choose a reason for hiding this comment

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

Version can contain suffixes such as "-preview". By convention, all our version numbers before the dash are are unique, i.e. given a version x.y-z1, we never have x.y-z2.

return false;
}

File.WriteAllText(
Copy link
Member

Choose a reason for hiding this comment

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

Use XDocument to load, update, save the file.

return true;
}

private static bool GetTeamCitySourceWriteToken( out string environmentVariableName, [NotNullWhen( true )] out string? teamCitySourceWriteToken )
Copy link
Member

Choose a reason for hiding this comment

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

Move to TeamCityHelper

@@ -17,6 +17,7 @@ public void GenerateTeamcityCode( TextWriter writer )
vcs {{
watchChangesInDependencies = {this.WatchChangesInDependencies.ToString().ToLowerInvariant()}
branchFilter = ""+:<default>""
triggerRules = ""-:comment=<<VERSION_BUMP>>:**""
Copy link
Member

Choose a reason for hiding this comment

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

Add comments.

return true;
}

if ( !IsVersionBumped( context, currentVersion, lastVersionTag ) )
Copy link
Member

Choose a reason for hiding this comment

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

Propose --force

@aweneer aweneer force-pushed the topic/story-30008-tag-publishing-and-version-bumping branch from d91b86a to 7295d46 Compare March 31, 2022 09:14
@aweneer aweneer requested a review from gfraiteur March 31, 2022 11:00
@aweneer aweneer merged commit 40daaf9 into master Apr 1, 2022
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.

2 participants