diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9af5f3e2f..6c5571be8 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -5,16 +5,26 @@ on: - v3 jobs: - publish: + npm: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 + - name: Checkout repository + uses: actions/checkout@v3.3.0 + - name: Get Node version from Node manifest + run: | + echo "NODE_VER=$(jq -r '.engines.node' package.json | sed 's/v//' )" >> $GITHUB_ENV + - name: Setup Node + uses: actions/setup-node@v3.6.0 with: - node-version: 18 + node-version: ${{ env.NODE_VER }} + cache: "npm" - - run: npm ci - - uses: JS-DevTools/npm-publish@v2 - with: - token: ${{ secrets.NPM_TOKEN }} - tag: stable + - name: Enable corepack + run: corepack enable + - name: Install dependencies + run: npm ci + - name: Publish to NPM + uses: JS-DevTools/npm-publish@v2 + with: + token: ${{ secrets.NPM_TOKEN }} + tag: stable diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef57d91fe..8a8fb5ca9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,19 +12,21 @@ concurrency: cancel-in-progress: true jobs: - test: - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - node-version: [14, 16, 18] - runs-on: ${{ matrix.os }} + e2e: steps: - - uses: actions/checkout@v3 - - uses: volta-cli/action@v1 + - name: Checkout repository + uses: actions/checkout@v3.3.0 + - name: Get Node version from Node manifest + run: | + echo "NODE_VER=$(jq -r '.engines.node' package.json | sed 's/v//' )" >> $GITHUB_ENV + - name: Setup Node + uses: actions/setup-node@v3.6.0 with: - node-version: ${{ matrix.node-version }} - npm-version: '8.5.0' - - run: npm ci - - run: npm run format - - run: npm run lint - - run: npm run test + node-version: ${{ env.NODE_VER }} + cache: "npm" + - name: Enable corepack + run: corepack enable + - name: Install dependencies + run: npm ci + - name: Run test + run: npm test diff --git a/package-lock.json b/package-lock.json index 06de26554..cf96ba823 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,9 @@ "prettier": "^2.7.1", "redtape": "^1.0.0", "tape": "^5.5.3" + }, + "engines": { + "node": "v20.5.0" } }, "node_modules/@ampproject/remapping": { diff --git a/package.json b/package.json index 3757c99f3..4c4a189ec 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,10 @@ "winresourcer": "^0.9.0", "yargs": "^17.5.1" }, + "engines": { + "node": "v20.5.0" + }, + "packageManager": "npm@9.8.1", "bin": { "nwbuild": "./bin/nwbuild.cjs" },