fix(build): remove React, mark as external during build #89
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: validate | |
on: | |
push: | |
branches: | |
- "+([0-9])?(.{+([0-9]),x}).x" | |
- "main" | |
- "next" | |
- "next-major" | |
- "beta" | |
- "alpha" | |
- "!all-contributors/**" | |
pull_request: {} | |
jobs: | |
main: | |
# ignore all-contributors PRs | |
if: ${{ !contains(github.head_ref, 'all-contributors') }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
- name: π₯ Install deps | |
run: npm install | |
- name: βΆοΈ Run validate script | |
run: npm run validate | |
- name: π₯ Install Playwright Browsers | |
id: playwright-version | |
run: | | |
echo "PLAYWRIGHT_VERSION=$(node -e "console.log(JSON.parse(require('child_process').execSync('npm info @playwright/test version --json')).trim())")" >> $GITHUB_ENV | |
- name: ποΈ Cache playwright binaries | |
uses: actions/cache@v4 | |
id: planwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- run: npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit == 'true' | |
- name: π Playwright tests | |
run: npx playwright test | |
- name: π Upload report | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
release: | |
needs: main | |
runs-on: ubuntu-latest | |
if: ${{ github.repository == 'abereghici/remix-themes' && | |
contains('refs/heads/main,refs/heads/beta,refs/heads/next,refs/heads/alpha', | |
github.ref) && github.event_name == 'push' }} | |
steps: | |
- name: π Cancel Previous Runs | |
uses: styfle/cancel-workflow-action@0.12.1 | |
- name: β¬οΈ Checkout repo | |
uses: actions/checkout@v4 | |
- name: β Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
- name: π₯ Install deps | |
run: | | |
# cp README.md packages/remix-themes | |
# node -e "let pkg=require('./package.json');pkg.workspaces=['packages/remix-themes'];require('fs').writeFileSync('./package.json',JSON.stringify(pkg),'utf8')" | |
npm install | |
- name: π Run build script | |
run: npm run build | |
- name: π Release | |
uses: cycjimmy/semantic-release-action@v4 | |
with: | |
working_directory: . | |
semantic_version: 17 | |
branches: | | |
[ | |
'+([0-9])?(.{+([0-9]),x}).x', | |
'main', | |
'next', | |
'next-major', | |
{name: 'beta', prerelease: true}, | |
{name: 'alpha', prerelease: true} | |
] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |