Skip to content

feat: update (#2858) #1231

feat: update (#2858)

feat: update (#2858) #1231

Workflow file for this run

name: Release
on:
push:
branches:
- main
env:
CI: true
NODE_VERSION: 20.x
NPM_SITE: https://registry.npmjs.org
jobs:
release:
name: Release
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
always-auth: true
registry-url: 'https://registry.npmjs.org'
scope: "@berviantoleo"
- name: Restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: corepack enable && corepack prepare yarn@stable --activate && yarn --immutable
- name: Build Package
run: yarn lerna run build --scope @berviantoleo/react-multi-crop
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/$GITHUB_REPOSITORY
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn lerna publish --yes
- name: Build Demo
run: yarn lerna run build --scope @berviantoleo/react-multi-crop-demo
env:
SKIP_PREFLIGHT_CHECK: true
PUBLIC_URL: /
DISABLE_ESLINT_PLUGIN: true
- name: Publish Demo
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
branch: demo # The branch the action should deploy to.
folder: examples/demo/build # The folder the action should deploy.
single-commit: true
docs:
name: Publish Docs
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
always-auth: true
- name: Restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: corepack enable && corepack prepare yarn@stable --activate && yarn --immutable
- name: Build Documentation
run: |
yarn docs
yarn lerna run docs --scope @berviantoleo/react-multi-crop
- name: Deploy Docs 🚀
uses: JamesIves/github-pages-deploy-action@v4.6.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
single-commit: true
coverage:
name: Coverage Upload
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
always-auth: true
- name: Restore lerna
uses: actions/cache@v4
with:
path: |
node_modules
*/*/node_modules
~/.cache/Cypress
key: ${{ runner.os }}-${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: corepack enable && corepack prepare yarn@stable --activate && yarn --immutable
- name: Lint
run: yarn lint
- name: Test & Build Package
run: |
yarn lerna run test --scope @berviantoleo/react-multi-crop
yarn lerna run build --scope @berviantoleo/react-multi-crop
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }} # required