-
Notifications
You must be signed in to change notification settings - Fork 81
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
chore: add pre releases config and job #2874
base: next
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
"@contentful/f36-modal": "4.68.1", | ||
"@contentful/f36-multiselect": "4.24.0", | ||
"@contentful/f36-navbar": "5.0.0-alpha.35", | ||
"@contentful/f36-navlist": "4.1.0-alpha.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This and the progress-stepper won't be bumped to the v5 when leaving the prerelease mode
@@ -139,6 +139,33 @@ jobs: | |||
command: | | |||
npm run-script changeset:publish | |||
|
|||
release_next: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to also add these changes to the main branch, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, isn't it only Vault that only works on main
?
RELEASES.md
Outdated
## Next branch | ||
|
||
The next branch is used for the new version of Forma 36, which will probably have breaking changes. To help the development of the new packages, we have setup an automatic publishing of the packages on that branch to the `alpha` tag. | ||
These packages aren't shown on the website as they can have breaking changes often. | ||
|
||
### How to automatic publish | ||
|
||
To make changeset publish a new version of the packages it's the same as in the `main` branch, it just requires having a changeset generated and specifing the packages. | ||
Differently from the `main` branch, neither the packages changelog or the **What's new page** will be updated, and the changeset files will not be removed. | ||
|
||
### Changeset configuration | ||
|
||
To make it possible we take advantage of changeset feature of prereleasing, to make it possible we have the [.changeset/pre.json](./.changeset/pre.json) which specifies which tag to use and the initial version of the packages, which is used to calculate the alpha version, for example: | ||
|
||
``` | ||
initial version: 4.61.2 | ||
|
||
For that initial version, each type of changeset would update as following: | ||
patch: 4.61.3-alpha.0 | ||
minor: 4.62.0-alpha.0 | ||
major: 5.0.0-alpha.0 | ||
|
||
If the initial version is already on the alpha tag, either version would bump the alpha.[x] | ||
``` | ||
|
||
_In our case we want all changes to be major so we work on the following major release._ | ||
|
||
**Config file explanation** | ||
|
||
The main differences on the config file are the following: | ||
|
||
```js | ||
{ | ||
"changelog": false // This is set so the changelog of the packages is not updated | ||
"ignore": [] // We don't want to ignore any package on the next branch | ||
"fixed": [] // We don't want to have fixed or linked versions of alpha releases | ||
"baseBranch": "next", // The branch which changesets uses to check versions | ||
"bumpVersionsWithWorkspaceProtocolOnly": true, // Avoid bumping dependencies on other packages | ||
} | ||
``` | ||
|
||
Notes: | ||
|
||
- The changelog is not updated because when we exit the prerelease state the changeset will compile all the changesets and apply onto the new version. eg. 5.0.0 will have all the changesets of the 5.0.0-alpha.\* | ||
- The `bumpVersionsWithWorkspaceProtocolOnly` makes it possible to avoid bumping packages on the packages that are dependent on the pacakge being updated, this is because we want alpha packages to depend on stable packages, rather than have all of them depending on alpha packages. ie. we would make all packages bump to an alpha core in case we update it. | ||
|
||
### Exiting prerelease | ||
|
||
When exiting the prerelease state, to make the packages stable some steps are necessary: | ||
|
||
```sh | ||
# We need to revert the .changeset/config.json file to write the changelog files | ||
|
||
npx changeset pre exit # This sets changeset to exit prerelease mode on the next changeset version | ||
|
||
npm run changelog:gen # Generates the .changelogrc file that is used to update the What's new page | ||
|
||
npx changeset version # This updates the packages changelogs and package.json | ||
|
||
npx changeset publish # To publish the packages. | ||
``` | ||
|
||
_Our CI already handles part of it, we would only need to revert the `.changeset/config.json` file and run the `npx changeset pre exit` command._ | ||
|
||
If the last commit on the branch before merging into `main` has those changes, the CI will handle the versioning, publishing and generating github releases as usual. | ||
|
||
### Differences in the CI | ||
|
||
The main difference in the release jobs on the CI, is that in the `next` branch we don't generate the `.changelogrc` file and don't generate the github releases. | ||
|
||
Other than that the proccess is the same: | ||
|
||
1. Build the packages | ||
2. Update the versioning | ||
3. commit the updated package.json file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if something is not clear, or if you want to change something
type: 'confirm', | ||
}, | ||
]); | ||
if (skip) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this to discourage the usage of the script, or should we entirely remove it??
"access": "public", | ||
"baseBranch": "main", | ||
"baseBranch": "next", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ these changes are only for the time while its a next branch or? So we will not merge it back to the main branch once we have the V5 finalized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because sadly we can't have mixed prereleases with releases, so we can only auto publish prereleases from the next branch.
And when merging it back to the main branch from the next, it would mean moving it to stable, for the main branch to auto publish it as stable, that I described on the RELEASES.md.
For alpha packages on the main branch we would still need to manually release sadly, or have two PRs, one pointing to the next branch to have the package published and one to the main branch to add the documentation.
|
||
### How to automatic publish | ||
|
||
To make changeset publish a new version of the packages it's the same as in the `main` branch, it just requires having a changeset generated and specifing the packages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ will this also be the npx changeset
command? Maybe would be good to add the exact command then also here in this seciton
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is the same command, I'll add the command on the documentation to make it clear.
I'll also update it to some steps that can be used locally to test the script as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have a quick tour of these changes together, that would help me review better.
|
||
### Changeset configuration | ||
|
||
To make it possible we take advantage of changeset feature of prereleasing, to make it possible we have the [.changeset/pre.json](./.changeset/pre.json) which specifies which tag to use and the initial version of the packages, which is used to calculate the alpha version, for example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make it possible we take advantage of changeset feature of prereleasing, to make it possible we have the [.changeset/pre.json](./.changeset/pre.json) which specifies which tag to use and the initial version of the packages, which is used to calculate the alpha version, for example: | |
We use the pre-releasing changeset feature and the [.changeset/pre.json](./.changeset/pre.json), which specifies which tag to use and the packages' initial versions. It allows to control the alpha version bump, for example: |
Notes: | ||
|
||
- The changelog is not updated because when we exit the prerelease state the changeset will compile all the changesets and apply onto the new version. eg. 5.0.0 will have all the changesets of the 5.0.0-alpha.\* | ||
- The `bumpVersionsWithWorkspaceProtocolOnly` makes it possible to avoid bumping packages on the packages that are dependent on the pacakge being updated, this is because we want alpha packages to depend on stable packages, rather than have all of them depending on alpha packages. ie. we would make all packages bump to an alpha core in case we update it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes: | |
- The changelog is not updated because when we exit the prerelease state the changeset will compile all the changesets and apply onto the new version. eg. 5.0.0 will have all the changesets of the 5.0.0-alpha.\* | |
- The `bumpVersionsWithWorkspaceProtocolOnly` makes it possible to avoid bumping packages on the packages that are dependent on the pacakge being updated, this is because we want alpha packages to depend on stable packages, rather than have all of them depending on alpha packages. ie. we would make all packages bump to an alpha core in case we update it. | |
> [!NOTE] | |
> | |
> - The changelog is not updated because after exiting the prerelease state, all the changesets will be compiled and applied to the new version. For example, `5.0.0` will have all the changesets of the `5.0.0-alpha.\*` | |
> - The `bumpVersionsWithWorkspaceProtocolOnly` prevents bumping packages' versions after a package they depend on is updated. This is because we want alpha packages to depend on stable packages. We would bump all packages to an alpha core if we allow it. |
It's possible to test how the version would change locally, make sure that your last changes are commited, and you can run the following commands depending on what needs to be tested. | ||
|
||
Remember to revert the changes made through the `npx changeset version` and not commit them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's possible to test how the version would change locally, make sure that your last changes are commited, and you can run the following commands depending on what needs to be tested. | |
Remember to revert the changes made through the `npx changeset version` and not commit them. | |
After committing your work, test the version's change by running these commands. | |
> [!WARNING] | |
> Remember to revert the changes made through the `npx changeset version` and not commit them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for expanding the release process documentation, I commented with some editorial nits ✍️
Purpose of PR
We want to make it possible to automatically release new alpha versions on the next branch.