-
Notifications
You must be signed in to change notification settings - Fork 15
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
Include workflow for automatic CHANGELOG and version bumps #913
Merged
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
38c2eea
Included version-changelog-update.yml to automatically bump the app's…
howard-e 6311b92
Update old package.json references
howard-e 9b3d6bf
Update NOTE under "Merging to releases"
howard-e ed547ed
Update docs/release.md with suggestion on 'will HAVE to' > 'MUST'
howard-e 610dc55
Reduce prescriptive language
howard-e 67b5f42
Use github-actions[bot] user for changelog commits
howard-e e794bbd
Merge branch 'main' into version_changelog_update
howard-e 6c6dbfc
Merge branch 'main' into version_changelog_update
howard-e cf8f23f
Apply release.md copy tweaks
howard-e 9a8049d
Apply suggestions from code review
howard-e File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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,39 @@ | ||
name: Version Bump and Changelog Update | ||
|
||
on: | ||
push: | ||
branches: | ||
- releases | ||
paths-ignore: | ||
- package.json | ||
- CHANGELOG.md | ||
|
||
jobs: | ||
version-changelog-update: | ||
permissions: | ||
contents: write | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Install NodeJS 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: npm | ||
- name: Conventional Changelog Action | ||
uses: TriPSs/conventional-changelog-action@v3 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
release-count: 0 | ||
preset: conventionalcommits | ||
- name: Pull changes from the development branch | ||
run: | | ||
git config --global pull.rebase false | ||
git pull origin development | ||
- name: Update development with version bump from CHANGELOG.md and package.json | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git push origin HEAD:development |
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
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,54 @@ | ||
# Expected workflow for the development to release process | ||
|
||
## Branching strategy | ||
|
||
- Checkout the `development` branch after cloning (or forking) the repository | ||
- Create an appropriately named branch | ||
|
||
## Commits | ||
|
||
To easily facilitate CHANGELOG generation, automatic version bumps (using [SEMVER](https://semver.org) - X.Y.Z) and version tagging, commit messages MUST follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) practice, which is used in combination with the GitHub Workflow Action, [TriPSs/conventional-changelog-action](https://github.com/TriPSs/conventional-changelog-action). | ||
howard-e marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
What this is means is that commits intended to automatically update the [CHANGELOG.md](https://github.com/w3c/aria-at-app/blob/development/CHANGELOG.md) and version must be written in a specific format: | ||
howard-e marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
<type>[optional scope]: <description> | ||
|
||
[optional body] | ||
|
||
[optional footer(s)] | ||
``` | ||
|
||
Additional examples are available [here](https://www.conventionalcommits.org/en/v1.0.0/#examples). | ||
|
||
Generally, commits in the following format will be sufficient: | ||
- `fix: <description>` will increment **PATCH** in X.Y.**Z** | ||
- `feat: <description>` will increment **MINOR** in X.**Y**.Z | ||
- `BREAKING CHANGE: OR '!' after any type/scope, eg. feat!: <description>` will increment **MAJOR** in **X**.Y.Z | ||
- NOTE: `zsh` users will have to surround commit messages with single quotes (`'<message>'`) instead of double quotes (`"<message>"`), as `!` is a special modifier for `zsh` | ||
|
||
**NOTE:** This doesn't mean is that ALL commits have to be written in this way, explained in [Merging Pull Request](#merging-pull-request). | ||
howard-e marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Creating Pull Request | ||
|
||
- Finalize work on branch | ||
- Create Pull Request from work on branch, typically using `development` as the target branch | ||
|
||
## Merging Pull Request | ||
|
||
### Merging to `development` | ||
|
||
Commits to `development` can either be done using a merge commit or it can be squashed. Squashing is preferred, depending on how the commits are structured. | ||
|
||
If the commits in the Pull Request are mainly following the Conventional Commits practice, using a merge commit would be appropriate, so the scoped commits are not lost when being included in the CHANGELOG. | ||
|
||
Otherwise, use the squash and merge method, and a type (and scope, if applicable) MUST be set for the squashed commits' title before merging. | ||
|
||
### Merging to `releases` | ||
|
||
Commits to `releases` MUST be merged with `Create a merge commit`, so that individual PRs or commits which have already been scoped at that point can be properly included in the CHANGELOG.md update. | ||
|
||
**NOTE:** The [version-changelog-update](https://github.com/w3c/aria-at-app/blob/development/.github/workflows/version-changelog-update.yml) workflow will automatically merge any new changes found in `releases` back into `development`, including the CHANGELOG.md update and any last minute changes before the release. | ||
|
||
## Releasing to production | ||
|
||
When deploying to production, merge `releases` into `main`. |
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
Oops, something went wrong.
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.
How about we require the tests to pass? I believe the syntax would be:
Along with a corresponding addition of
workflow_call
toruntest.yml
.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 like the thought, although I would have liked to hope the tests were confirmed as passing to have even got there? Seems doing something like the following in
runtest.yml
to avoid doubling up on that run should be done:Seems useful as well on #912, for an automated deployment.