Skip to content

Commit

Permalink
ci: automate release and changelog generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Frazer Smith committed Feb 26, 2021
1 parent d50e57b commit 3c2c6bf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,16 @@ jobs:
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request' }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Create/Update Release Pull Request
if: github.ref == 'refs/heads/master'
needs: [commit-lint, lint, unit-tests]
runs-on: ubuntu-latest
steps:
- name: Release Please
id: release
uses: GoogleCloudPlatform/release-please-action@v2.20.1
with:
changelog-types: '[ { "type": "feat", "section": "Features", "hidden": false }, { "type": "fix", "section": "Bug Fixes", "hidden": false }, { "type": "build", "section": "Dependencies", "hidden": false }, { "type": "chore", "section": "Miscellaneous", "hidden": false }, { "type": "ci", "section": "Miscellaneous", "hidden": false }, { "type": "perf", "section": "Performance", "hidden": false }, { "type": "refactor", "section": "Miscellaneous", "hidden": false }, { "type": "style", "section": "Miscellaneous", "hidden": false }, { "type": "docs", "section": "Documentation", "hidden": false }]'
release-type: node
11 changes: 0 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,6 @@ Prior to submitting a pull request back to the main repository, please make sure
2. Run `npm test` to check the code adheres to the defined style and that it passes the Jest tests
3. Run `npm run lint:prettier` to run the Prettier code formatter over the code

## Release Process

When cutting a release, the following steps need to be performed:

1. Create a release branch with the convention `release/x.x.x`
2. `package.json` needs to have a version update based on the content being released, remembering to adhere to semantic versioning
3. Generate the changelog with `npm run changelog`
4. Create a tag for the version; the naming convention is the version (vx.x.x)
5. Push the tag to the repository
6. Draft a release in the release tab with release notes, copying the notes from the changelog

## Issues

Please file your issues [here](https://github.com/Fdawgs/fastify-disablecache/issues) and try to provide as much information in the template as possible/relevant.
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
"node": ">=10.22.0"
},
"scripts": {
"changelog": "conventional-changelog -p @commitlint/config-conventional -s -i CHANGELOG.md && prettier CHANGELOG.md --write",
"jest": "jest --detectOpenHandles --runInBand",
"jest:coverage": "jest --coverage --runInBand",
"lint": "eslint . --cache --ext js,jsx --ignore-path .gitignore",
"lint:licenses": "license-checker --direct --onlyAllow=\"0BSD;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;Unlicense\" --production --summary",
"lint:prettier": "prettier . --write --ignore-path .gitignore",
"lint:prettier:ci": "prettier . --check --ignore-path .gitignore",
"lint:prettier": "prettier \"**/!(CHANGELOG.md|package.json)\" --write --ignore-path .gitignore --ignore-unknown",
"lint:prettier:ci": "prettier \"**/!(CHANGELOG.md|package.json)\" --check --ignore-path .gitignore --ignore-unknown",
"test": "npm run lint && npm run jest"
},
"commitlint": {
Expand Down Expand Up @@ -65,7 +64,6 @@
"devDependencies": {
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"conventional-changelog-cli": "^2.1.1",
"eslint": "^7.18.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-config-prettier": "^7.1.0",
Expand Down

0 comments on commit 3c2c6bf

Please sign in to comment.