diff --git a/.github/workflows/jsonata.yml b/.github/workflows/jsonata.yml new file mode 100644 index 00000000..0ad620cc --- /dev/null +++ b/.github/workflows/jsonata.yml @@ -0,0 +1,65 @@ +name: Build and publish JSONata +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test + publish: + needs: build + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.repository == 'jsonata-js/jsonata' }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + registry-url: 'https://registry.npmjs.org' + - name: Install and build + run: npm install && npm test + - name: Publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + documentation: + needs: build + runs-on: ubuntu-latest + if: ${{ github.event_name == 'push' && github.repository == 'jsonata-js/jsonata' }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Use Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Build documentation + run: | + cd website + npm install + npm run build + - name: Deploy to GitHub Pages + if: success() + run: | + cd website + git config --global user.name "andrew-coleman" + git config --global user.email "andrew_coleman@uk.ibm.com" + echo "machine github.com login ${GIT_USER} password ${{ secrets.GITHUB_TOKEN }}" > ~/.netrc + npm run publish-gh-pages + env: + GIT_USER: andrew-coleman diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml deleted file mode 100644 index 41f312fa..00000000 --- a/.github/workflows/node.js.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Node.js CI - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12.x, 14.x, 16.x] - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - run: npm install - - run: npm test - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c5e50c30..00000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: node_js -node_js: -- '16' -- '14' -- '12' -after_success: -- npm run coveralls -jobs: - include: - - stage: documentation - if: branch = master AND repo = jsonata-js/jsonata - script: - - echo "Publishing documentation..." - - git config --global user.name "${GH_NAME}" - - git config --global user.email "${GH_EMAIL}" - - echo "machine github.com login ${GH_NAME} password ${GH_TOKEN}" > ~/.netrc - - cd website && npm install && GIT_USER="${GH_NAME}" npm run publish-gh-pages - - stage: npm release - if: branch = master AND repo = jsonata-js/jsonata - node_js: '14' - script: echo "Deploying to npm..." - deploy: - provider: npm - skip_cleanup: true - email: andrew_coleman@uk.ibm.com - api_key: - secure: rRX8uazdYTePyTNfVKIkdp5nXFBG4vwLSeL/1VMhdvwGjW61zIWhcQ+b5a82tiRN2utXvA6E63MMaO8XqaAACS7uOjl0Eti7O2YR5aStE6S7VsC6GCLDMcf1Io66gNxmjWgKnXOm8q0GhRq93nPec1bG4s3r6IWBGJLdFkfmppjTtaot2KgblVt0GPX5NUE+CQEGpx8d9Y67ai7XNibvrOXVxt6iN7l7fiOWuWzeSDif5QhzYI+277kcZjOBrUELkjLfTrBm8OKWhIyheLfupoY8KtkleYKb7rsnSMD5GxP7yhZKw2U9Z/MHcD79d15DuFE+loXdjrXrIzp4HMlWCWxfwEDZ3QH/H7Wjm1qbqZp9NLUSE2WySuwz7n7fF5yTJd8WT4qqm6XQEwF4HA5k6koZJfaK/1CsBsg2rV+pOz/v84H2kE4WNUbgBKJNfh/fknTV1TcSfbz3X9EGLUDH/HK7pW5oaJgUPTBMd9216W2KvRxvF67O18FaePqJAU89t4BUUrGazsEmfcovsCNyrrPifZwvDzG7Bu62jvbhLcO8WmRVlJ5qLiuMFFp+kiGWlLzRoWTNX+TsIbe/PsZnjmPRuja7ABoWUbdJZWM4TA/V8nwe3aciU80QAxcDJHjOAygr9kngdmec5WAS+8p7nlh76qDoTzDUE1ryB6HyM0k= diff --git a/src/jsonata.js b/src/jsonata.js index 8b4a68ca..ce52096c 100644 --- a/src/jsonata.js +++ b/src/jsonata.js @@ -112,7 +112,7 @@ var jsonata = (function() { case 'transform': result = evaluateTransformExpression(expr, input, environment); break; - } + } if (Object.prototype.hasOwnProperty.call(expr, 'predicate')) { for(var ii = 0; ii < expr.predicate.length; ii++) {