Bump the development-dependencies group across 1 directory with 25 updates #892
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: 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 ] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .node-version | |
registry-url: 'https://registry.npmjs.org' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
- name: Install compatible testing library for older react versions | |
if: ${{ matrix.react-version }} < 18 | |
run: pnpm add -D @testing-library/react@12 | |
- name: Install React v${{ matrix.react-version }} | |
run: pnpm i react@${{ matrix.react-version }} react-dom@${{ matrix.react-version }} | |
- name: Test build | |
run: pnpm run build | |
- name: Test React v${{ matrix.react-version }} | |
run: 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@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: .node-version | |
registry-url: 'https://registry.npmjs.org' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- 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 }} |