Skip to content

Automated Update for Version v1.14.0 (#178) #514

Automated Update for Version v1.14.0 (#178)

Automated Update for Version v1.14.0 (#178) #514

Workflow file for this run

name: CI Workflows
on:
push:
branches: ["main"]
tags:
- "v*"
pull_request:
jobs:
lint-and-test:
strategy:
matrix:
version: [18, 19, 20, 21, 22]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
id: setup-node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
cache: npm
- name: Install JavaScript Dependencies
run: |
npm clean-install
- name: Lint
if: success() || failure()
run: |
npm run lint
- name: Type Check
if: success() || failure()
run: |
npm run type-check
- name: Check Patch Orig/Rej Files Aren't in the Patch File
if: success() || failure()
run: |
if grep -q -e '\.orig' -e '\.rej' src/lib/api.patch; then
echo "Found .orig or .rej in src/lib/api.patch, clean those up please."
exit 1
else
echo "No .orig or .rej found in src/lib/api.patch, all good."
fi
- name: Build
if: success() || failure()
run: |
npm run build
# We only run the browser tests for the development version of node because the browser environment
# is independent of the node version, so all that matters is the build we deploy works in the browser.
- name: Conditionally Install Chrome Dependencies
if: (success() || failure()) && matrix.version == 18
run: |
sudo apt-get install -y libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libgbm1 libasound2 libpangocairo-1.0-0 libxss1 libgtk-3-0
- name: Conditionally Remove Browser Tests
if: (success() || failure()) && matrix.version != 18
run: |
rm test/browser.test.ts
- name: Test
if: success() || failure()
run: |
npm run test:fast
deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [lint-and-test]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.19.0
registry-url: "https://registry.npmjs.org"
- name: Extract Version from Tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Install JavaScript Dependencies
run: npm clean-install
- name: Update package.json Version
run: npm version --no-git-tag-version $VERSION
- name: Build With Updated Version
if: success() || failure()
run: |
npm run build
- name: Publish to NPM
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}