Skip to content

Commit

Permalink
[CI] Run the CI on different node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Pewtro committed Jul 15, 2024
1 parent 95d31dc commit ba0156e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@ on:

concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
# The node version to release with, generally the latest LTS
release_node: 20.x

jobs:
release:
strategy:
matrix:
# Test against multiple node versions
# Last LTS, current LTS, current, and next LTS (if not same as current)
node: [18.x, 20.x, 21.x, 22.x]
name: Release
runs-on: ubuntu-latest
steps:
Expand All @@ -21,10 +30,10 @@ jobs:
with:
version: 9

- name: Setup Node.js 20.x
- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: 20.15
node-version: ${{ matrix.node }}
cache: 'pnpm'

- name: Install Dependencies
Expand All @@ -37,8 +46,8 @@ jobs:
run: pnpm test:ci

# Only run the release step if the push is to the main or next branch
- name: Create Release Pull Request or Publish to npm
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next')
- if: ${{ matrix.node == env.release_node && github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next') }}
name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
Expand Down

0 comments on commit ba0156e

Please sign in to comment.