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

feat: use Git notes to store the channels on which a version has been released #1368

Merged
merged 1 commit into from
Dec 3, 2019

Conversation

pvdlg
Copy link
Member

@pvdlg pvdlg commented Nov 28, 2019

BREAKING CHANGE

this feature change the way semantic-release keep track of the channels on which a version has been released.

It now use a JSON object stored in a Git note instead of Git tags formatted as v{version}@{channel}.

The tags formatted as v{version}@{channel} will now be ignored. If you have made releases with v16.0.0 on branches other than the default one you will have to update your repository.

The changes to make consist in:

  • Finding all the versions that have been released on a branch other than the default one by searching for all tags formatted v{version}@{channel}
  • For each of those version:
    • Create a tag without the {@channel} if none doesn't already exists
    • Add a Git note to the tag without the {@channel} containing the channels on which the version was released formatted as {"channels":["channel1","channel2"]} and using null for the default channel (for example.{"channels":[null,"channel1","channel2"]})
    • Push the tags and notes
    • Update the GitHub releases that refer to a tag formatted as v{version}@{channel} to use the tag without it
    • Delete the tags formatted as v{version}@{channel}

Fix #1191, Fix #1101

See this script to help with the migration: https://gist.github.com/pvdlg/6b19e529ee5c1a20645675a44e5b3239

@gr2m
Copy link
Member

gr2m commented Nov 28, 2019

I've created a test repository here: https://github.com/gr2m/semantic-release-test-1368

I tested the happy paths without any rebasing of beta or next so far. It all worked as expected: https://github.com/gr2m/semantic-release-test-1368/releases 👍👍👍

@pvdlg
Copy link
Member Author

pvdlg commented Nov 28, 2019

A good test would be to run what's described in https://github.com/semantic-release/semantic-release/tree/beta/docs/recipes#release-workflow

… released

BREAKING CHANGE: this feature change the way semantic-release keep track of the channels on which a version has been released.
It now use a JSON object stored in a [Git note](https://git-scm.com/docs/git-notes) instead of Git tags formatted as v{version}@{channel}.

The tags formatted as v{version}@{channel} will now be ignored. If you have made releases with v16.0.0 on branches other than the default one you will have to update your repository.

The changes to make consist in:
- Finding all the versions that have been released on a branch other than the default one by searching for all tags formatted v{version}@{channel}
- For each of those version:
  - Create a tag without the {@channel} if none doesn't already exists
  - Add a Git note to the tag without the {@channel} containing the channels on which the version was released formatted as `{"channels":["channel1","channel2"]}` and using `null` for the default channel (for example.`{"channels":[null,"channel1","channel2"]}`)
  - Push the tags and notes
  - Update the GitHub releases that refer to a tag formatted as v{version}@{channel} to use the tag without it
  - Delete the tags formatted as v{version}@{channel}
@pvdlg pvdlg merged commit b2c1b2c into beta Dec 3, 2019
@pvdlg pvdlg deleted the git-notes branch December 3, 2019 04:38
@semantic-release-bot
Copy link
Collaborator

🎉 This PR is included in version 16.0.0-beta.39 🎉

The release is available on:

Your semantic-release bot 📦🚀

@semantic-release-bot
Copy link
Collaborator

🎉 This PR is included in version 16.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants