Fix Package.swift being updated after tag #1710
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL/DR; This PR should fix #1674.
What it does
Adds a simple script called
release-move-tag.sh
underConfigurations
. It runs as a separate step inmake release
.I chose to have it as a separate script to improve readability and to allow Xcode to build the Distribution target without invoking anything tag-related.
The script checks that there have been no commits since latest tag to prevent accidentally moving an old tag. Indeed, the script expects to be run after tagging the release just before
make release
, so there should be no commits in-between.Tests
I've tested the following successfully:
make release
and approve moving the tagIt all seemed ok to me. All that would be left is pushing to remote and uploading the corresponding artifacts (including the ZIP for SPM).
Up for review
I thought about adding some version checks but it seems a little overkill as it seems already safe enough. The script actually asks for user approval before moving the tag. Accordingly,
make release
requires one interaction if we are really releasing (and asks so before opening the directory with the assets to be uploaded). We could also remove the interaction entirely and just commit Package.swift and move the tag whenever there have been no commits since latest tag.I've added comments that are up for review. Naturally, once the changes are approved, I'll do the same on the 2.x branch (EDIT: now available #1711).