Skip to content

v6.22.0

v6.22.0 #932

name: Build, Test, Publish
on:
pull_request:
branches:
- '*'
push:
branches:
- main
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/gh-pages'
name: Test React v${{ matrix.react-version }}
strategy:
matrix:
react-version: [ 16, 17, 18, 19 ]
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Run Tests
run: |
set -x
react="react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }}"
pnpm install
if test ${{ matrix.react-version }} -lt 18
then pnpm update $react @testing-library/react@12
else pnpm update $react @testing-library/react
fi
pnpm test
publish:
if: github.event_name == 'release' && github.event.action == 'published'
needs: test
runs-on: ubuntu-latest
name: Publish Package
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .node-version
registry-url: 'https://registry.npmjs.org'
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Publish
run: |
pnpm install
pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Deploy Docs
run: |
pnpm install
./cli build:www
pnpm wrangler pages deploy \
--project-name react-social-icons \
www/dist
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}