Skip to content

Commit

Permalink
Github action for beta version publishing on NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlurie committed Nov 8, 2024
1 parent 3ed4b81 commit 369aeb9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/format-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18

Expand Down
21 changes: 18 additions & 3 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,28 @@ jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}

- uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run make
- run: npm publish --access public

- name: Publish NPM package (regular)
if: "!github.event.release.prerelease"
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

- name: Publish NPM package (pre-release)
if: "github.event.release.prerelease"
run: |
npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# MapTiler SDK Changelog

## 2.4.2
### Others
- Now able to GitHub action a beta on NPM from the GH release creation process
- Updated GH action to v4

## 2.4.1
### Bug Fixes
- 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)
Expand Down

0 comments on commit 369aeb9

Please sign in to comment.