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

chore: add semantic-release to update changelog programmatically #465

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Added `your feature` that allows ...
- [ ] I formatted JS and TS files with running `yarn lint:fix` in the root folder
- [ ] I have run tests via `yarn test` in the root folder
- [ ] I updated the documentation with running `yarn generate` in the root folder
- [ ] I mentioned this change in `CHANGELOG.md`
- [ ] I updated the typings files (`index.d.ts`)
- [ ] I added/updated a sample (`/example`)

Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ jobs:
with:
NVMRC: ${{ needs.lint_test_generate.outputs.NVMRC }}

semantic_release:
needs: [lint_test_generate, call_android_workflow, call_ios_workflow]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

publish:
if: startsWith(github.ref, 'refs/tags/')
needs: [lint_test_generate, call_android_workflow, call_ios_workflow]
Expand Down
16 changes: 16 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"branches": ["main"],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
["@semantic-release/npm", {
"npmPublish": false
}],
"@semantic-release/github",
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}]
]
}
10 changes: 1 addition & 9 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@ If not, make sure to investigate the issue and fix it prior to a release.

Once you verified, that `master` isn't broken, go on and increase the `version` within our `package.json`.

## Update the CHANGELOG accordingly

Our [`CHANGELOG.md`](https://github.com/maplibre/maplibre-react-native/blob/master/CHANGELOG.md) should be updated whenever a PR is merged/ noteworthy changes are committed to `master`.
Prior to a release, the changes should be documented under the `UNRELEASED` section.
Once it's clear, that a release is about to be published, move the items under `UNRELEASED` to _this_ releases sections.
Let your actions be guided by the previous release entries.

## Draft a new release on Github

Within the [releases](https://github.com/maplibre/maplibre-react-native/releases) section of the repo you can [`Draft a new release`](https://github.com/maplibre/maplibre-react-native/releases/new).

`Tag version` & `Release title` should be the same.
As redundant as it might sound, please add the changes from the `CHANGELOG.md` into the body of the release.
`Tag version` & `Release title` should be the same.

## Monitor the repos issues for updates

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@
"@react-native/eslint-config": "^0.73.2",
"@react-native/eslint-plugin": "^0.74.0",
"@react-native/metro-config": "^0.72.7",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@sinonjs/fake-timers": "^11.2.2",
"@testing-library/react-native": "^12.4.3",
"@tsconfig/node14": "^14.1.0",
Expand Down Expand Up @@ -98,6 +100,7 @@
"react-docgen": "rnmapbox/react-docgen#rnmapbox-dist",
"react-native": "0.72.1",
"react-test-renderer": "^18.2.0",
"semantic-release": "^19.0.3",
"typescript": "^5.3.3"
},
"resolutions": {
Expand Down
Loading