diff --git a/.github/workflows/create-bumb-version-pr.yml b/.github/workflows/create-bumb-version-pr.yml new file mode 100644 index 0000000..0f45a17 --- /dev/null +++ b/.github/workflows/create-bumb-version-pr.yml @@ -0,0 +1,39 @@ +name: Create bump version PR + +on: + workflow_dispatch: + inputs: + version: + description: Version to change to. + required: true + type: string + +jobs: + bump-version-pr: + name: Bump version PR + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main + + - name: Use Node.js from nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Bump version + run: | + npm version --commit-hooks false --git-tag-version false ${{ inputs.version }} + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + commit-message: Bump version to ${{ inputs.version }} + branch: bump-version-to-${{ inputs.version }} + title: Bump version to ${{ inputs.version }} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4a57866..eda0a8d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,31 +1,98 @@ name: publish on: - workflow_dispatch: push: - tags: - - v* + branches: [main] + workflow_dispatch: jobs: - publish: - name: Publish + release-check: + name: Check if version changed runs-on: ubuntu-latest + defaults: + run: + shell: bash steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main + + - name: Use Node.js from nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + + - name: Check if version has been updated + id: check + uses: EndBug/version-check@v2 + + outputs: + publish: ${{ steps.check.outputs.changed }} + + release: + name: Release + needs: release-check + if: ${{ needs.release-check.outputs.publish == 'true' }} + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main - - name: Use Node.js x64 - uses: actions/setup-node@v2 + - name: Use Node.js from nvmrc + uses: actions/setup-node@v4 with: - node-version: 16 - architecture: x64 - registry-url: "https://registry.npmjs.org" + node-version-file: '.nvmrc' + registry-url: 'https://registry.npmjs.org' - - name: Install build dependencies + - name: Get version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 + + - name: Install & build run: | npm ci + npm run build-dist - - name: Publish + - name: Publish NPM package run: | - npm publish --access=public --non-interactive + npm publish --access=public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} + + - name: Tag commit and push + id: tag_version + uses: mathieudutour/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ steps.package-version.outputs.current-version }} + + - name: Create GitHub Release + id: create_regular_release + uses: ncipollo/release-action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag: ${{ steps.tag_version.outputs.new_tag }} + name: ${{ steps.tag_version.outputs.new_tag }} + body: 'Changes since last release:\n ${{ steps.tag_version.outputs.changelog }}' + allowUpdates: true + draft: false + prerelease: false + + - name: Build the Docs + run: | + npm run docs + + - name: Publish the docs + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs + commit_message: 'deploy docs: ${{ steps.tag_version.outputs.new_tag }}' \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2028187..539c0a4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,14 +10,12 @@ jobs: name: test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js x64 - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: - node-version: 16 - architecture: x64 - registry-url: "https://registry.npmjs.org" + node-version-file: '.nvmrc' - name: Install build dependencies run: | @@ -27,3 +25,7 @@ jobs: - name: Test run: | npm test + + - name: Docs + run: | + npm run docs diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..89e0c3d --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.10 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f322635..b96a60b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,19 @@ ### Bug fixes 🐛 +## 1.6.0 + +### Features / Improvements 🚀 + +- Make the clear button type="button" by @daiwai in https://github.com/maplibre/maplibre-gl-geocoder/pull/116 +- Modernize the codebase using typescript typings, rollup, typedoc and jest. by @HarelM in https://github.com/maplibre/maplibre-gl-geocoder/pull/118 + +### Bug fixes 🐛 + +- Fixed issues with `events` dependency https://github.com/maplibre/maplibre-gl-geocoder/issues/104 +- Fixed links to "Carmen GeoJSON" format reference https://github.com/maplibre/maplibre-gl-geocoder/issues/110 +- Fixed a lot of documentation issues by linking the docs to the code itself https://github.com/maplibre/maplibre-gl-geocoder/pull/118 + ## 1.5.0 ### Features / Improvements 🚀 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c99683..0b6e08c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,19 +16,8 @@ Lastly, run the test command from the console: Follow this deploy process after all changes for the release are merged into main. You will copy and paste this checklist in the comment of the release pull request. -``` + ## Release checklist -1. Create a branch off `main` and a pull request with the following changes. Copy this checklist in the comment of the pull request. - - [ ] Update the [CHANGELOG.md](https://github.com/thaddmt/maplibre-gl-geocoder/blob/main/CHANGELOG.md) by comparing the last release and what is on `main`. In the changelog, replace the `main` heading with the to-be-released stable version. - - [ ] Update the version number in `package.json` and `package-lock.json`. -3. Request a PR review and then merge it into `main`. -4. Tag the release and start the build. - - [ ] Make sure you've pulled in all changes to `main` locally. - - [ ] Build the release with `npm run prepublish && npm run docs` - - [ ] Commit and push with commit message `vX.X.X` - - [ ] Create the git tag for the release with `git tag -a vX.X.X -m 'vX.X.X'` - - [ ] Push the tags with `git push --tags` - - [ ] Run `npm publish` - -``` +Using github actions, create a bump version PR, update the changelog in that PR. +Merge it to main and the rest will be done using Github actions. diff --git a/package-lock.json b/package-lock.json index 3e502a7..e73ac15 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@maplibre/maplibre-gl-geocoder", - "version": "1.5.0", + "version": "1.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@maplibre/maplibre-gl-geocoder", - "version": "1.5.0", + "version": "1.6.0", "license": "ISC", "dependencies": { "events": "^3.3.0", diff --git a/package.json b/package.json index 4adaa92..159f883 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@maplibre/maplibre-gl-geocoder", - "version": "1.5.0", + "version": "1.6.0", "description": "A geocoder control for Maplibre GL JS", "main": "dist/maplibre-gl-geocoder.js", "module": "dist/maplibre-gl-geocoder.mjs",