Merge remote-tracking branch 'upstream/master' into express-5
This commit is contained in:
commit
9f60ddad27
5 changed files with 95 additions and 23 deletions
81
.github/workflows/release.yml
vendored
81
.github/workflows/release.yml
vendored
|
@ -14,9 +14,41 @@ on:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
release-check:
|
||||||
|
name: Check if version is published
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: 'package.json'
|
||||||
|
check-latest: true
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Check if version is published
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
currentVersion="$( node -e "console.log(require('./package.json').version)" )"
|
||||||
|
isPublished="$( npm view tileserver-gl versions --json | jq -c --arg cv "$currentVersion" 'any(. == $cv)' )"
|
||||||
|
echo "version=$currentVersion" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "published=$isPublished" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "currentVersion: $currentVersion"
|
||||||
|
echo "isPublished: $isPublished"
|
||||||
|
outputs:
|
||||||
|
published: ${{ steps.check.outputs.published }}
|
||||||
|
version: ${{ steps.check.outputs.version }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
needs: release-check
|
||||||
|
if: ${{ needs.release-check.outputs.published == 'false' }}
|
||||||
name: 'Build, Test, Publish'
|
name: 'Build, Test, Publish'
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
env:
|
||||||
|
PACKAGE_VERSION: ${{ needs.release-check.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository ✨
|
- name: Check out repository ✨
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -54,17 +86,23 @@ jobs:
|
||||||
- name: Remove Test Data
|
- name: Remove Test Data
|
||||||
run: rm -R test_data*
|
run: rm -R test_data*
|
||||||
|
|
||||||
- name: Publish to Full Version NPM
|
- name: Get release type
|
||||||
|
id: prepare_release
|
||||||
|
run: |
|
||||||
|
RELEASE_TYPE="$(node -e "console.log(require('semver').prerelease('${{ needs.release-check.outputs.version }}') ? 'prerelease' : 'regular')")"
|
||||||
|
if [[ $RELEASE_TYPE == 'regular' ]]; then
|
||||||
|
echo "prerelease=false" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "prerelease=true" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Publish to NPM
|
||||||
run: |
|
run: |
|
||||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||||
npm publish --access public
|
npm publish --access public --tag ${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }}
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
run: |
|
|
||||||
echo "PACKAGE_VERSION=$(grep '"version"' package.json | cut -d '"' -f 4 | head -n 1)" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
with:
|
with:
|
||||||
|
@ -84,24 +122,42 @@ jobs:
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: maptiler/tileserver-gl:latest, maptiler/tileserver-gl:v${{ env.PACKAGE_VERSION }}
|
tags: |
|
||||||
|
maptiler/tileserver-gl:${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }},
|
||||||
|
maptiler/tileserver-gl:v${{ env.PACKAGE_VERSION }}
|
||||||
platforms: linux/arm64,linux/amd64
|
platforms: linux/arm64,linux/amd64
|
||||||
# experimental: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
||||||
|
- name: Extract changelog for version
|
||||||
|
run: |
|
||||||
|
awk '/^##/ { p = 0 }; p == 1 { print }; $0 == "## ${{ env.PACKAGE_VERSION }}" { p = 1 };' CHANGELOG.md > changelog_for_version.md
|
||||||
|
cat changelog_for_version.md
|
||||||
|
|
||||||
|
- name: Publish to Github
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag: v${{ env.PACKAGE_VERSION }}
|
||||||
|
name: v${{ env.PACKAGE_VERSION }}
|
||||||
|
bodyFile: changelog_for_version.md
|
||||||
|
allowUpdates: true
|
||||||
|
draft: false
|
||||||
|
prerelease: ${{ env.PRERELEASE }}
|
||||||
|
|
||||||
- name: Create Tileserver Light Directory
|
- name: Create Tileserver Light Directory
|
||||||
run: node publish.js --no-publish
|
run: node publish.js --no-publish
|
||||||
|
|
||||||
- name: Install node dependencies
|
- name: Install node dependencies
|
||||||
run: npm install
|
run: npm ci --prefer-offline --no-audit
|
||||||
working-directory: ./light
|
working-directory: ./light
|
||||||
|
|
||||||
- name: Publish to Light Version NPM
|
- name: Publish to Light Version NPM
|
||||||
working-directory: ./light
|
working-directory: ./light
|
||||||
run: |
|
run: |
|
||||||
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
|
||||||
npm publish --access public
|
npm publish --access public --tag ${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }}
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
NPM_TOKEN: ${{ github.event.inputs.npm_token }}
|
||||||
|
|
||||||
|
@ -111,8 +167,9 @@ jobs:
|
||||||
context: ./light
|
context: ./light
|
||||||
file: ./light/Dockerfile
|
file: ./light/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: maptiler/tileserver-gl-light:latest, maptiler/tileserver-gl-light:v${{ env.PACKAGE_VERSION }}
|
tags: |
|
||||||
|
maptiler/tileserver-gl-light:${{ needs.release-check.outputs.prerelease == 'true' && 'next' || 'latest' }},
|
||||||
|
maptiler/tileserver-gl-light:v${{ env.PACKAGE_VERSION }}
|
||||||
platforms: linux/arm64,linux/amd64
|
platforms: linux/arm64,linux/amd64
|
||||||
# experimental: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api
|
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: type=gha,mode=max
|
cache-to: type=gha,mode=max
|
||||||
|
|
7
CHANGELOG.md
Normal file
7
CHANGELOG.md
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# tileserver-gl changelog
|
||||||
|
|
||||||
|
## 5.0.0
|
||||||
|
* Update Maplibre-Native to [v6.0.0](https://github.com/maplibre/maplibre-native/releases/tag/node-v6.0.0) release by @acalcutt in https://github.com/maptiler/tileserver-gl/pull/1376 and @dependabot in https://github.com/maptiler/tileserver-gl/pull/1381
|
||||||
|
* This first release that use Metal for rendering instead of OpenGL (ES) for macOS.
|
||||||
|
* This the first release that uses OpenGL (ES) 3.0 on Windows and Linux
|
||||||
|
* Note: Windows users may need to update their [c++ redistributable ](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170) for maplibre-native v6.0.0
|
|
@ -1,13 +1,19 @@
|
||||||
# Publishing new version
|
# Publishing new version
|
||||||
|
|
||||||
- Update version in `package.json`
|
1.) Change the version number in package.json. Run the following command in the package root directory, replacing <update_type> with one of the semantic versioning release types (prerelease, prepatch, preminor, premajor, patch, minor, major):
|
||||||
- `git tag vx.x.x`
|
npm version <update_type> --preid pre --no-git-tag-version
|
||||||
- `git push --tags`
|
|
||||||
- `docker buildx build --platform linux/amd64 -t maptiler/tileserver-gl:latest -t maptiler/tileserver-gl:[version] .`
|
--preid specifies which suffix to use in the release such as pre, next, beta, rc, etc.
|
||||||
- `docker push maptiler/tileserver-gl --all-tags`
|
|
||||||
- `npm publish --access public` or `node publish.js`
|
prepatch, preminor, and premajor start a new series of pre-releases while bumping the patch, minor, or major version. E.g. premajor with --preid pre would do a prerelease for a new major using the -pre suffix (i.e. it would be a new major with -pre.0)
|
||||||
- `node publish.js --no-publish`
|
|
||||||
- `cd light`
|
You can use prerelease to bump the version for a new pre-release version. E.g. you could run npm version prerelease --preid pre --no-git-tag-version to go from -pre.0 to -pre.1.
|
||||||
- `docker buildx build --platform linux/amd64 -t maptiler/tileserver-gl-light:latest -t maptiler/tileserver-gl-light:[version] .`
|
|
||||||
- `docker push maptiler/tileserver-gl-light --all-tags`
|
For regular versions, you can use patch, minor, or major. E.g. npm version major --no-git-tag-version.
|
||||||
- `npm publish --access public`
|
|
||||||
|
2.) Update the changelog, which can be found in CHANGELOG.md. The heading must match ## <VERSION> exactly, or it will not be picked up. For example, for version 5.0.0:
|
||||||
|
```## 5.0.0```
|
||||||
|
|
||||||
|
3.) Commit and push the changes.
|
||||||
|
|
||||||
|
4.) Run the 'Build, Test, Release' github workflow. The workflow will create a NPM, Docker, and Github release and Tag.
|
||||||
|
|
1
package-lock.json
generated
1
package-lock.json
generated
|
@ -33,6 +33,7 @@
|
||||||
"pmtiles": "3.0.7",
|
"pmtiles": "3.0.7",
|
||||||
"proj4": "2.12.1",
|
"proj4": "2.12.1",
|
||||||
"sanitize-filename": "1.6.3",
|
"sanitize-filename": "1.6.3",
|
||||||
|
"semver": "^7.6.3",
|
||||||
"sharp": "0.33.5",
|
"sharp": "0.33.5",
|
||||||
"tileserver-gl-styles": "2.0.0"
|
"tileserver-gl-styles": "2.0.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
"pmtiles": "3.0.7",
|
"pmtiles": "3.0.7",
|
||||||
"proj4": "2.12.1",
|
"proj4": "2.12.1",
|
||||||
"sanitize-filename": "1.6.3",
|
"sanitize-filename": "1.6.3",
|
||||||
|
"semver": "^7.6.3",
|
||||||
"sharp": "0.33.5",
|
"sharp": "0.33.5",
|
||||||
"tileserver-gl-styles": "2.0.0"
|
"tileserver-gl-styles": "2.0.0"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue