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
ci: semantic-release #1270
Merged
Merged
ci: semantic-release #1270
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c3ac7d1
ci: semantic-release
gr2m 74d46aa
docs(CONTRIBUTING): initial version
gr2m 414b752
ci(semantic-pull-request): Always validate the PR title, and ignore t…
gr2m 4c12689
docs(CONTRIBUTING): ammend note on "Create a merge commit" button
gr2m 2af893b
Update CONTRIBUTING.md
gr2m ce795ab
Update semantic.yml
gr2m File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# https://github.com/zeke/semantic-pull-requests#configuration | ||
|
||
# Always validate the PR title, and ignore the commits | ||
titleOnly: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- next | ||
- beta | ||
- "*.x" # maintenance releases such as 2.x | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
- run: npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Contributing | ||
|
||
Thank you for considering to contribute to `node-fetch` 💖 | ||
|
||
Please note that this project is released with a [Contributor Code of Conduct][./CODE_OF_CONDUCT.md]. | ||
By participating you agree to abide by its terms. | ||
|
||
## Setup | ||
|
||
Node.js 12.20 or higher is required. Install it from https://nodejs.org/en/. [GitHub's `gh` CLI](https://cli.github.com/) is recommended for the initial setup | ||
|
||
1. Fork this repository and clone it to your local machine. Using `gh` you can do this | ||
|
||
``` | ||
gh repo fork node-fetch/node-fetch | ||
``` | ||
|
||
2. After cloning and changing into the `node-fetch` directory, install dependencies and run the tests | ||
|
||
``` | ||
npm install | ||
npm test | ||
``` | ||
|
||
## Issues before pull requests | ||
|
||
Unless the change is trivial such as a type, please [open an issue first](https://github.com/node-fetch/node-fetch/issues/new) before starting a pull request for a bug fix or a new feature. | ||
|
||
After you cloned your fork, create a new branch and implement the changes in them. To start a pull request, you can use the `gh` CLI | ||
|
||
``` | ||
gh pr create | ||
``` | ||
|
||
## Maintainers only | ||
|
||
### Merging the Pull Request & releasing a new version | ||
|
||
Releases are automated using [semantic-release](https://github.com/semantic-release/semantic-release). | ||
The following commit message conventions determine which version is released: | ||
|
||
1. `fix: ...` or `fix(scope name): ...` prefix in subject: bumps fix version, e.g. `1.2.3` → `1.2.4` | ||
2. `feat: ...` or `feat(scope name): ...` prefix in subject: bumps feature version, e.g. `1.2.3` → `1.3.0` | ||
3. `BREAKING CHANGE:` in body: bumps breaking version, e.g. `1.2.3` → `2.0.0` | ||
|
||
Only one version number is bumped at a time, the highest version change trumps the others. | ||
Besides, publishing a new version to npm, semantic-release also creates a git tag and release | ||
on GitHub, generates changelogs from the commit messages and puts them into the release notes. | ||
|
||
If the pull request looks good but does not follow the commit conventions, update the pull request title and use the <kbd>Squash & merge</kbd> button, at which point you can set a custom commit message. | ||
|
||
### Beta/Next/Maintenance releases | ||
|
||
`semantic-release` supports pre-releases and maintenance releases. | ||
|
||
In order to release a maintenance version, open a pull request against a `[VERSION].x` branch, e.g. `2.x`. As long as the commit conventions documented above are followed, a maintenance version will be released. Breaking changes are not permitted. | ||
|
||
In order to release a beta version, create or re-create the `beta` branch based on the latest `main` branch. Then create a pull request against the `beta` branch. When merged into the `beta` branch, a new `...-beta.X` release will be created. Once ready, create a pull request against `main` (or `next` if you prefer). This pull request be merged using `squash & merge`. | ||
|
||
**Important**: do not rebase & force push to the `beta` branch while working on pre-releases. Do only use force push to reset the `beta` branch in order to sync it with the latest `main`. | ||
|
||
To release a `next` version, create or re-create the `next` branch based on the latest `main` branch. Then create a pull request against the `next` branch. When merged into the `next` branch, a new version is created based on the commit conventions, but published using the `next` dist-tag to npm and marked as pre-release on GitHub. | ||
|
||
**Important**: do not rebase & force push to the `next` branch while working on pre-releases. Do only use force push to reset the `next` branch in order to sync it with the latest `main`. Also, when merging `next` into `main`, **do not use squash & merge**! In this particular case, the traditional "Create a merge commit" merge button has to be used, otherwise semantic-release will not be able to match the commit history and won't be able to promote the existing releases in npm or GitHub. If the button is disabled, temporarily enable it in the repository settings. | ||
|
||
For any semantic-release questions, ping [@gr2m](https://github.com/gr2m). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Does
next
need any special config, likebeta
, or it is automatically picked up from the name?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 automatically picked up from the name