From 1181f118cd51b9fa7fa2b8bc599207b03bf50adc Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Mon, 9 Oct 2023 10:38:05 +0300 Subject: [PATCH] Update CI configs --- .github/workflows/build.yml | 19 ++++++------------ .github/workflows/publish.yml | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7a9226..4577bc8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,14 @@ name: build -on: - push: +on: [push] jobs: - build: + test: name: Build @questdb/nodejs-questdb-client runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16, 20] steps: - name: Checkout repository uses: actions/checkout@v3 @@ -16,7 +18,7 @@ jobs: - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: ${{ matrix.node-version }} - name: Install dependencies run: npm ci @@ -26,12 +28,3 @@ jobs: - name: Run linter run: npm run eslint - - - name: Publish @questdb/nodejs-questdb-client to npm - if: github.ref == 'refs/heads/main' - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.CI_TOKEN }} - access: public - check-version: true - package: package.json diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d51574e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,38 @@ +name: build + +on: + push: + branches: + - main + +jobs: + build: + name: Publish @questdb/nodejs-questdb-client to npm + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install dependencies + run: npm ci + + - name: Run tests + run: npm test + + - name: Run linter + run: npm run eslint + + - name: Publish + uses: JS-DevTools/npm-publish@v2 + with: + token: ${{ secrets.CI_TOKEN }} + access: public + strategy: all + package: package.json