Skip to content

Commit eaf0f7c

Browse files
Github action for beta version publishing on NPM (#135)
1 parent 94d3467 commit eaf0f7c

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

.github/workflows/format-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Check out Git repository
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111

1212
- name: Set up Node.js
13-
uses: actions/setup-node@v3
13+
uses: actions/setup-node@v4
1414
with:
1515
node-version: 18
1616

.github/workflows/npm-publish.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,28 @@ jobs:
1111
build-and-publish:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
14+
- name: Checkout repo
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.event.release.target_commitish }}
18+
19+
- uses: actions/setup-node@v4
1620
with:
1721
node-version: 18
1822
registry-url: https://registry.npmjs.org/
1923
- run: npm ci
2024
- run: npm run make
21-
- run: npm publish --access public
25+
26+
- name: Publish NPM package (regular)
27+
if: "!github.event.release.prerelease"
28+
run: |
29+
npm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
32+
33+
- name: Publish NPM package (pre-release)
34+
if: "github.event.release.prerelease"
35+
run: |
36+
npm publish --tag next
2237
env:
2338
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
### Bug Fixes
55
- The language switching is now more robust and preserves the original formatting from the style (`Map.setPrimaryLangage()`) (https://github.com/maptiler/maptiler-sdk-js/pull/134)
66

7+
### Others
8+
- Now able to GitHub action a beta on NPM from the GH release creation process
9+
- Updated GH action to v4
10+
11+
12+
713
## 2.4.1
814
### Bug Fixes
915
- The class `AJAXError` is now imported as part of the `maplibregl` namespace (CommonJS limitation from Maplibre GL JS) (https://github.com/maptiler/maptiler-sdk-js/pull/129)

0 commit comments

Comments
 (0)