From 9b9d672b8af7e004f8a290fe05b80301b71a6240 Mon Sep 17 00:00:00 2001 From: magicjar <9734293+magicjar@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:52:34 +0700 Subject: [PATCH] [Actions] Node 20 --- .github/workflows/release-publish.yml | 15 ++++++++++----- .github/workflows/ts-test.yml | 26 ++++++++++++-------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index cd6f1c9..b86883f 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -9,9 +9,13 @@ jobs: name: Release runs-on: ubuntu-latest + strategy: + matrix: + node: [20] + steps: - name: Clone repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Create release id: create_release @@ -28,12 +32,12 @@ jobs: steps: - name: Clone repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 12 + node-version: ${{ matrix.node }} registry-url: https://registry.npmjs.org/ - name: Checkout tag @@ -42,6 +46,7 @@ jobs: git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) - name: Run publish - run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + npm publish --access public || { echo "Publishing failed"; exit 1; } diff --git a/.github/workflows/ts-test.yml b/.github/workflows/ts-test.yml index 28a42cf..c4b69b9 100644 --- a/.github/workflows/ts-test.yml +++ b/.github/workflows/ts-test.yml @@ -8,34 +8,32 @@ jobs: strategy: matrix: - node: [12] + node: [20] steps: - name: Clone repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - name: Set up npm cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | - ${{ runner.os }}-node- + ${{ runner.os }}-node-${{ matrix.node }}- - name: Install dependencies - run: | - npm ci || { echo "NPM install failed. Check logs."; exit 1; } - - - name: Run compile - run: npm run compile-all + run: npm ci - - name: Run test - run: npm run test + - name: Compile and Run Tests + run: | + npm run compile-all + npm run test - name: Upload npm debug log if: failure() @@ -47,4 +45,4 @@ jobs: - name: Coveralls uses: coverallsapp/github-action@master with: - github-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + github-token: "${{ secrets.GITHUB_TOKEN }}"