From 560802b789e0cd26cf7ab8ac2d04dce52420eed9 Mon Sep 17 00:00:00 2001 From: Christopher Pardy Date: Mon, 3 Jul 2023 14:21:27 -0400 Subject: [PATCH] Add Linting to CI, split deployment Add Linting to the CI and move deployment out of the on pull request bit so it doesn't trigger on pull requests. --- .github/workflows/deploy.yml | 42 +++++++++++++++++++++++++++++++++++ .github/workflows/node.js.yml | 9 ++------ 2 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..646a2d9 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,42 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Deploy Package + +on: + push: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm run build --if-present + - run: npm run lint + - run: npm test + deploy: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 18.x + - run: npm install + - run: npm run build --if-present + # https://github.com/marketplace/actions/npm-publish + - uses: JS-DevTools/npm-publish@v2 + with: + token: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0db88d4..1ad05a6 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -4,8 +4,6 @@ name: Node.js CI on: - push: - branches: [ master, next-major ] pull_request: branches: [ master, next-major ] @@ -16,7 +14,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 @@ -26,8 +24,5 @@ jobs: node-version: ${{ matrix.node-version }} - run: npm install - run: npm run build --if-present + - run: npm run lint - run: npm test - # https://github.com/marketplace/actions/npm-publish - - uses: JS-DevTools/npm-publish@v2 - with: - token: ${{ secrets.NPM_TOKEN }}