tileserver-gl-light 5.2.0-pre.1 → 5.2.0-pre.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,6 +65,22 @@ jobs:
65
65
  context: .
66
66
  push: false
67
67
  platforms: linux/arm64,linux/amd64
68
- # experimental: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api
68
+ cache-from: type=gha
69
+ cache-to: type=gha,mode=max
70
+
71
+ - name: Create Tileserver Light Directory
72
+ run: node publish.js --no-publish
73
+
74
+ - name: Install node dependencies
75
+ run: npm ci --prefer-offline --no-audit
76
+ working-directory: ./light
77
+
78
+ - name: Test Light Version to Docker Hub
79
+ uses: docker/build-push-action@v6
80
+ with:
81
+ context: ./light
82
+ file: ./light/Dockerfile
83
+ push: false
84
+ platforms: linux/arm64,linux/amd64
69
85
  cache-from: type=gha
70
86
  cache-to: type=gha,mode=max
package/CHANGELOG.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # tileserver-gl changelog
2
2
 
3
- ## 5.2.0-pre.1
3
+ ## 5.2.0-pre.3
4
4
  * Use npm packages for public/resources (https://github.com/maptiler/tileserver-gl/pull/1427) by @okimiko
5
5
  * use ttf files of googlefonts/opensans (https://github.com/maptiler/tileserver-gl/pull/1447) by @okimiko
6
6
  * Limit Elevation Lat/Long Output Length (https://github.com/maptiler/tileserver-gl/pull/1457) by @okimiko
7
7
  * Fetch style from url (https://github.com/maptiler/tileserver-gl/pull/1462) by @YoelRidgway
8
8
  * fix: memory leak on SIGHUP (https://github.com/maptiler/tileserver-gl/pull/1455) by @okimiko
9
- * fix: resolves Unimplemented type: 3 error for geojson format #1465
9
+ * fix: resolves Unimplemented type: 3 error for geojson format (https://github.com/maptiler/tileserver-gl/pull/1465) by @rjdjohnston
10
+ * fix: Test light version in ct workflow - fix sqlite build in light (https://github.com/maptiler/tileserver-gl/pull/1477) by @acalcutt
11
+ * fix: light version docker entrypoint permissions (https://github.com/maptiler/tileserver-gl/pull/1478) by @acalcutt
10
12
 
11
13
  ## 5.1.3
12
14
  * Fix SIGHUP (broken since 5.1.x) (https://github.com/maptiler/tileserver-gl/pull/1452) by @okimiko
package/Dockerfile CHANGED
@@ -1,4 +1,42 @@
1
- FROM ubuntu:jammy
1
+ FROM ubuntu:jammy AS builder
2
+
3
+ ENV NODE_ENV="production"
4
+
5
+ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
6
+
7
+ RUN export DEBIAN_FRONTEND=noninteractive && \
8
+ apt-get update && \
9
+ apt-get install -y --no-install-recommends --no-install-suggests \
10
+ build-essential \
11
+ ca-certificates \
12
+ curl \
13
+ gnupg && \
14
+ mkdir -p /etc/apt/keyrings && \
15
+ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
16
+ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
17
+ apt-get -qq update && \
18
+ apt-get install -y --no-install-recommends --no-install-suggests nodejs && \
19
+ npm i -g npm@latest && \
20
+ apt-get -y remove curl gnupg && \
21
+ apt-get -y --purge autoremove && \
22
+ apt-get clean && \
23
+ rm -rf /var/lib/apt/lists/*
24
+
25
+ RUN mkdir -p /usr/src/app
26
+
27
+ WORKDIR /usr/src/app
28
+
29
+ COPY package.json /usr/src/app
30
+ COPY package-lock.json /usr/src/app
31
+
32
+ RUN npm config set maxsockets 1 && \
33
+ npm config set fetch-retries 5 && \
34
+ npm config set fetch-retry-mintimeout 100000 && \
35
+ npm config set fetch-retry-maxtimeout 600000 && \
36
+ npm ci --omit=dev && \
37
+ chown -R root:root /usr/src/app
38
+
39
+ FROM ubuntu:jammy AS final
2
40
 
3
41
  ENV \
4
42
  NODE_ENV="production" \
@@ -26,18 +64,14 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
26
64
  apt-get clean && \
27
65
  rm -rf /var/lib/apt/lists/*
28
66
 
29
- WORKDIR /usr/src/app
30
- COPY . .
67
+ COPY --from=builder /usr/src/app /usr/src/app
31
68
 
32
- RUN npm config set maxsockets 1 && \
33
- npm config set fetch-retries 5 && \
34
- npm config set fetch-retry-mintimeout 100000 && \
35
- npm config set fetch-retry-maxtimeout 600000 && \
36
- npm install --omit=dev && \
37
- chown -R root:root . && \
38
- chmod +x ./docker-entrypoint.sh
69
+ COPY . /usr/src/app
70
+
71
+ RUN mkdir -p /data && \
72
+ chown node:node /data && \
73
+ chmod +x /usr/src/app/docker-entrypoint.sh
39
74
 
40
- RUN mkdir -p /data && chown node:node /data
41
75
  VOLUME /data
42
76
  WORKDIR /data
43
77
 
package/PUBLISHING.md CHANGED
@@ -1,19 +1,112 @@
1
- # Publishing new version
1
+ # Publishing a New Version
2
2
 
3
- 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):
4
- npm version <update_type> --preid pre --no-git-tag-version
3
+ This document outlines the process for publishing new versions of this project. We use a GitHub workflow for automated releases, but also provide manual steps for specific situations.
5
4
 
6
- --preid specifies which suffix to use in the release such as pre, next, beta, rc, etc.
5
+ ## Automated Publishing via GitHub Workflow (Recommended)
7
6
 
8
- 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)
7
+ This is the preferred method for publishing new versions. It automates the entire process, including version bumping, tagging, building, and publishing.
9
8
 
10
- 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.
9
+ 1. **Prepare the Release:**
11
10
 
12
- For regular versions, you can use patch, minor, or major. E.g. npm version major --no-git-tag-version.
11
+ * **Choose the Version Increment:** Determine the appropriate semantic versioning increment (prerelease, prepatch, preminor, premajor, patch, minor, major).
13
12
 
14
- 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:
15
- ```## 5.0.0```
13
+ * **Update `package.json`:** Use the `npm version` command to bump the version number. This command also supports creating pre-release versions using the `--preid pre` flag.
16
14
 
17
- 3.) Commit and push the changes.
15
+ ```bash
16
+ # Example: Increment to a new patch version
17
+ npm version patch --no-git-tag-version
18
18
 
19
- 4.) Run the 'Build, Test, Release' github workflow. The workflow will create a NPM, Docker, and Github release and Tag.
19
+ # Example: Increment to a new minor version
20
+ npm version minor --no-git-tag-version
21
+
22
+ # Example: Increment to a new major version
23
+ npm version major --no-git-tag-version
24
+
25
+ # Example: Create a pre-release (e.g., -pre.0) version
26
+ npm version prepatch --preid pre --no-git-tag-version
27
+ # OR
28
+ npm version preminor --preid pre --no-git-tag-version
29
+ # OR
30
+ npm version premajor --preid pre --no-git-tag-version
31
+
32
+ # Example: Increment an existing pre-release version (e.g., -pre.0 to -pre.1)
33
+ npm version prerelease --preid pre --no-git-tag-version
34
+ ```
35
+
36
+ * `--no-git-tag-version`: This prevents `npm version` from automatically creating a git tag, as the GitHub workflow will handle this later.
37
+ * `--preid pre`: Specifies that "pre" is the pre-release identifier.
38
+
39
+ * **Update the Changelog (`CHANGELOG.md`):** Add a new section for the release. The heading *must* exactly match the format `## <VERSION>`, where `<VERSION>` is the full version number from `package.json`. Describe the changes included in the release.
40
+
41
+ ```markdown
42
+ ## 1.2.3
43
+ * Added new feature X.
44
+ ```
45
+
46
+ 2. **Commit and Push:** Commit the changes to `package.json`, `package-lock.json` and `CHANGELOG.md` to a branch. Create a pull request (PR) for review. If you are an administrator, you may push directly, but a PR is generally recommended for code review.
47
+
48
+ 3. **Run the GitHub Workflow:** Once the PR is merged (or changes pushed directly), trigger the "Build, Test, Release" GitHub workflow. This workflow is responsible for:
49
+
50
+ * Building the project.
51
+ * Running tests.
52
+ * Creating an NPM package.
53
+ * Building and pushing Docker images.
54
+ * Creating a GitHub Release.
55
+ * Creating a Git tag for the release.
56
+
57
+ ## Manual Publishing (For Special Cases)
58
+
59
+ Use the following steps *only* when the automated workflow is not suitable (e.g., for debugging, specific environment needs).
60
+
61
+ 1. **Update Version in `package.json`:** Modify the `version` field in `package.json` to the desired version number.
62
+
63
+ 2. **Create and Push Git Tag:**
64
+
65
+ ```bash
66
+ git tag vX.X.X # Replace X.X.X with the version number
67
+ git push origin --tags
68
+ ```
69
+
70
+ 3. **NPM Publish Options (Choose ONE):**
71
+
72
+ * **Option A: Publish only the full `tileserver-gl` version:**
73
+
74
+ ```bash
75
+ npm publish --access public
76
+ ```
77
+
78
+ * **Option B: Build and Publish both `tileserver-gl` and `tileserver-gl-light` using `publish.js`:**
79
+
80
+ ```bash
81
+ # This script builds the light version and publishes both tileserver-gl and tileserver-gl-light to NPM.
82
+ node publish.js
83
+ ```
84
+
85
+ * **Option C: Build only the `tileserver-gl-light` version (no publish):**
86
+
87
+ ```bash
88
+ # This script ONLY builds the light version (e.g., for local testing or Docker image creation) without publishing.
89
+ node publish.js --no-publish
90
+ ```
91
+
92
+ 4. **Build and Push Docker Images:**
93
+
94
+ ```bash
95
+ # Build the main image
96
+ docker buildx build --platform linux/amd64 -t maptiler/tileserver-gl:latest -t maptiler/tileserver-gl:X.X.X . # Replace X.X.X
97
+ docker push maptiler/tileserver-gl --all-tags
98
+
99
+ # Build the light image
100
+ cd light
101
+ docker buildx build --platform linux/amd64 -t maptiler/tileserver-gl-light:latest -t maptiler/tileserver-gl-light:X.X.X . # Replace X.X.X
102
+ docker push maptiler/tileserver-gl-light --all-tags
103
+ cd .. # Return to the project root
104
+ ```
105
+ * Make sure you are logged into the docker registry before pushing. `docker login`
106
+
107
+ **Important Considerations for Manual Publishing:**
108
+
109
+ * **Consistency:** Ensure the version number in `package.json`, the Git tag, and the Docker image tags are identical.
110
+ * **Credentials:** Verify that you have the necessary permissions to push Docker images and publish to NPM.
111
+ * **Cleanliness:** Before building Docker images, ensure your working directory is clean to avoid including unwanted files in the image.
112
+ * **Error Handling:** Manually publishing is more prone to errors. Double-check each step to avoid issues.
@@ -3,5 +3,7 @@
3
3
  * Limit Elevation Lat/Long Output Length (https://github.com/maptiler/tileserver-gl/pull/1457) by @okimiko
4
4
  * Fetch style from url (https://github.com/maptiler/tileserver-gl/pull/1462) by @YoelRidgway
5
5
  * fix: memory leak on SIGHUP (https://github.com/maptiler/tileserver-gl/pull/1455) by @okimiko
6
- * fix: resolves Unimplemented type: 3 error for geojson format #1465
6
+ * fix: resolves Unimplemented type: 3 error for geojson format (https://github.com/maptiler/tileserver-gl/pull/1465) by @rjdjohnston
7
+ * fix: Test light version in ct workflow - fix sqlite build in light (https://github.com/maptiler/tileserver-gl/pull/1477) by @acalcutt
8
+ * fix: light version docker entrypoint permissions (https://github.com/maptiler/tileserver-gl/pull/1478) by @acalcutt
7
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tileserver-gl-light",
3
- "version": "5.2.0-pre.1",
3
+ "version": "5.2.0-pre.3",
4
4
  "description": "Map tile server for JSON GL styles - serving vector tiles",
5
5
  "main": "src/main.js",
6
6
  "bin": "src/main.js",
@@ -38,6 +38,7 @@
38
38
  "clone": "2.1.2",
39
39
  "color": "4.2.3",
40
40
  "commander": "12.1.0",
41
+ "copyfiles": "2.4.1",
41
42
  "cors": "2.8.5",
42
43
  "express": "5.0.1",
43
44
  "handlebars": "4.7.8",