From 37e5cdaeef482e9a67b8b21607afc6b13d3b065d Mon Sep 17 00:00:00 2001 From: Aleksei Ivanov Date: Wed, 31 Jul 2024 21:03:26 +0300 Subject: [PATCH] [chore] Fit Github Workflows --- .github/workflows/main.yml | 19 ++++++++++--------- .github/workflows/publish.yml | 18 ++++++++++++------ package.json | 2 +- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b14f748..ad5a85a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,28 +10,29 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node: ['22.x'] - os: [ubuntu-latest, windows-latest] + node: ['22.0'] + os: [ubuntu-latest] steps: - name: Config Git (Mainly for Windows) run: git config --global core.autocrlf false - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Use Node ${{ matrix.node }} - uses: actions/setup-node@v1 + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install Node ${{ matrix.node }} + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - - uses: pnpm/action-setup@v4 - name: Install pnpm + cache: 'pnpm' - name: Install deps and build (with cache) run: pnpm install - - name: Lint + - name: Lint code run: pnpm lint # Did not work without local files with test data # - name: Test diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f6237b8..0eab3fd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,7 @@ name: Publish to NPM on: release: types: [created] + jobs: build: runs-on: ubuntu-latest @@ -9,16 +10,21 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Install pnpm + uses: pnpm/action-setup@v4 + # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v2 + - name: Install Node 22.0 + uses: actions/setup-node@v4 with: - node-version: '22.x' + node-version: '22.0' registry-url: 'https://registry.npmjs.org' + cache: 'pnpm' - - uses: pnpm/action-setup@v4 - - - run: pnpm install + - name: Install deps and build (with cache) + run: pnpm install - - run: pnpm publish + - name: Publish build + run: pnpm publish env: NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/package.json b/package.json index 2e5c07a..2e2f350 100644 --- a/package.json +++ b/package.json @@ -129,7 +129,7 @@ "eslint" ] }, - "packageManager": "^pnpm@9.6.0", + "packageManager": "pnpm@9.6.0", "browser": { "_process": false, "fs": false,