RFC: swift package publish-precheck

Swift packages can be in a bunch of states which makes them inappropriate for tagging or publishing. I think having a command to detect such states would be valuable for Swift package authors. In future, this can even evolve into a larger tag-and-publish workflow feature. Here is my mini-proposal for this command:

  • Add a "swift package publish-precheck" command which will run a bunch of checks to determine if the current state of the package is appropriate for publishing. Please suggest if you have a better spelling for this command.
  • The command will run a predefined list of checks and will report if a check failed or passed. Failed checks will contain proper diagnostics describing why they failed.
  • The initial list of checks:
    • Use of a local dependency
    • Use of a branch or revision based dependency
    • Uncommitted changes
    • Existing tag with the current HEAD
    • A dependency in edit mode
    • At least one (library?) product

What do others think?

9 Likes