You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When publishing a package with mono publish, Mono will shell out to a language-specific package publishing command. If that command fails, then the local git repository will be left in an inconsistent state. There will be a commit in the current branch in your local repository describing the release that didn't happen, and a tag, named after the version that was never published, pointing to that commit.
To re-attempt the release, the following manual steps are necessary before running mono publish again:
git reset --hard HEAD^ to remove the "Publish package" commit
git tag -d <tag> to remove the tag pointing to that commit
If the "Publish package" commit is not manually removed, Mono will warn that there are no changes and abort the publishing process at the beginning. However, if the tag is not manually removed, Mono will go ahead with the release, resulting in a failure before reaching the language-specific publishing command, when attempting to create a tag that already exists.
There are many ways this could be addressed at different levels, theoretically at least:
I like that we make a commit before publishing to the package managers. I did that on purpose so we can be very sure that the current state is the same as the published package. Previously it published first and then committed, which could result in some different state (due to Git hooks).
As you say, we can have better handling for when things go wrong.
We can add a check for the tag existence.
We can revert the commit and tag on publish failure.
When publishing a package with
mono publish
, Mono will shell out to a language-specific package publishing command. If that command fails, then the local git repository will be left in an inconsistent state. There will be a commit in the current branch in your local repository describing the release that didn't happen, and a tag, named after the version that was never published, pointing to that commit.To re-attempt the release, the following manual steps are necessary before running
mono publish
again:git reset --hard HEAD^
to remove the "Publish package" commitgit tag -d <tag>
to remove the tag pointing to that commitIf the "Publish package" commit is not manually removed, Mono will warn that there are no changes and abort the publishing process at the beginning. However, if the tag is not manually removed, Mono will go ahead with the release, resulting in a failure before reaching the language-specific publishing command, when attempting to create a tag that already exists.
There are many ways this could be addressed at different levels, theoretically at least:
git tag -f
)The text was updated successfully, but these errors were encountered: