Merge pull request #491 from matthewp/dependabot/npm_and_yarn/changes… #120
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
- name: Install NPM Dependencies | |
run: npm ci | |
- name: Build JavaScript | |
run: | | |
npm run build | |
- name: Upload Package Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: lib/ | |
if-no-files-found: error | |
test: | |
name: "Test: ${{ matrix.os }} (node@${{ matrix.node_version }})" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node_version: [22, 23] | |
fail-fast: false | |
needs: [build] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node@${{ matrix.node_version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node_version }} | |
cache: "npm" | |
- name: Install NPM Dependencies | |
run: npm ci | |
env: | |
CI: true | |
- name: Run tests | |
run: npm run test | |
env: | |
CI: true | |
changelog: | |
name: Changelog PR or Release | |
if: ${{ github.ref_name == 'main' && github.repository_owner == 'matthewp' }} | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
- name: Install NPM Dependencies | |
run: npm ci | |
- name: Build JavaScript | |
run: | | |
npm run build | |
- name: Create Release Pull Request or Publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: npm run changeset publish | |
commit: "[ci] release" | |
title: "[ci] release" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |