Merge branch 'release/v1.4.0-js-attempt-2' into main #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: Node.js Package | |
on: | |
workflow_dispatch: | |
push: | |
branches: main | |
paths: javascript/** | |
pull_request: | |
branches: main | |
paths: javascript/** | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
path: [./javascript/] | |
steps: | |
- name: Checkout of the repository | |
uses: actions/checkout@v3 | |
- name: Configuration of the Node v${{matrix.node-version}} setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{matrix.node-version}} | |
- name: Installation of the dependencies (for NPM) | |
run: npm --prefix ${{matrix.path}} ci | |
- name: Running the tests | |
run: npm --prefix ${{matrix.path}} test | |
publish-npm: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
path: [./javascript/] | |
steps: | |
- name: Checkout of the repository | |
uses: actions/checkout@v3 | |
- name: Configuration of the Node v${{matrix.node-version}} setup | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{matrix.node-version}} | |
registry-url: https://registry.npmjs.org/ | |
- name: Installation of the dependencies (for NPM) | |
run: npm --prefix ${{matrix.path}} ci | |
- name: \"dist/\" folder deletion | |
run: npm --prefix ${{matrix.path}} run clear-dist-folder | |
- name: Build ECMAScript module | |
run: npm --prefix ${{matrix.path}} run build-esm | |
- name: Build CommonJS module | |
run: npm --prefix ${{matrix.path}} run build-cjs | |
- name: Build Asynchronous module definition | |
run: npm --prefix ${{matrix.path}} run build-amd | |
- name: Build Universal module definition | |
run: npm --prefix ${{matrix.path}} run build-umd | |
- name: Build types | |
run: npm --prefix ${{matrix.path}} run build-types | |
- name: Publishing to NPM | |
run: npm --prefix ${{matrix.path}} run publish-to-npm | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |