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 Package.swift #1751

Merged
merged 5 commits into from
Feb 5, 2021
Merged

Fix Package.swift #1751

merged 5 commits into from
Feb 5, 2021

Conversation

thebluepotato
Copy link
Contributor

I'll do the change for the 2.x branch ASAP, but this fixes the showstopping bug in #1750. Major change is that Package.swift now uses the latest tag instead of the version number so it can be used for pre-release versions as well. It still includes the "final" version number even though it is not used in any way anymore.
IMPORTANT: it seems that during the release of 1.25.0-rc1 two things were overlooked:

  • SPM needs the tag to follow semantic versioning to be able to resolve the git repo. 1.25.0rc1 does not follow semantic versioning whereas 1.25.0-rc1 does. I've updated make-release-package.sh to check whether the latest tag follows semantic versioning based on a modified version of the "official" RegEx: https://semver.org/. It outputs a warning if the tag does not follow semantic versioning. In that case, you should delete the tag, tag again and run make release again.
  • The "force tag" stage at the end of make release defaults to no and seems to have been overlooked. As there are other safeguards in place (only moves the tag when nothing else has been committed), it now defaults to yes.

Fixes #1750

Checklist:

  • My change is being tested and reviewed against the Sparkle 2.x branch. New changes must be developed on the 2.x development branch first.
  • My change is being backported to master branch (Sparkle 1.x), if deemed necessary. Please create a separate pull request for 1.x, should it be backported.
  • I have reviewed and commented my code, particularly in hard-to-understand areas.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • My change is or requires a documentation or localization update

Testing

I tested and verified my change by using one or multiple of these methods:

  • Sparkle Test App
  • Unit Tests
  • My own app
  • Other: Ran make release with tag 1.25.0-rc2, successfully moves the tag and uses the correct url in Package.swift

macOS version tested: 11.2

Improves prompt asking to force move tag (default is NO, but can be triggered after `make release`). Fixes issues with single quotes in make-release-package.sh.
@kornelski
Copy link
Member

Unit tests fail, probably on git describe:

fatal: No names found, cannot describe anything.
Command ExternalBuildToolExecution failed with a nonzero exit code

@thebluepotato
Copy link
Contributor Author

Unit tests fail, probably on git describe:

fatal: No names found, cannot describe anything.
Command ExternalBuildToolExecution failed with a nonzero exit code

Yes indeed! I've seen that too and I'm thinking I should either put that behind a check whether we're running GitHub actions or move it to the release-move-tag.sh script.

Have the GitHub actions replaced the make release workflow entirely or is it only for checks? In the first instance, this would require some deeper reworking (such as integrating the update to Package.swift within those actions)...

Only check and update tag in Package.swift when not running a CI build. As long as GitHub actions are reserved for tests, this should be ok as this is a "fake" update of Package.swift anyway. If you ever use GitHub actions for releases, you'll probably have to rethink the tagging logic once again
@zorgiepoo zorgiepoo requested review from zorgiepoo and removed request for zorgiepoo February 5, 2021 03:47
@zorgiepoo
Copy link
Member

(changes look reasonable on my end, will trust best judgement here)

Now provides an error and exits when not complying with SemVer
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.

The version tag 1.25.0rc1 is not readable by SwiftPM
3 participants