Skip to content

chore: write README file and setup CI/CD for npm auto-publish #3

chore: write README file and setup CI/CD for npm auto-publish

chore: write README file and setup CI/CD for npm auto-publish #3

Workflow file for this run

name: Publish to npm
on:
push:
branches:
- main
pull_request:
branches:
- develop
jobs:
publish:
runs-on: ubuntu-latest
steps:
# 1. Checkout repository
- name: Checkout repository
uses: actions/checkout@v3
# 2. Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'
# 3. Enable Corepack for Yarn
- name: Enable Corepack for Yarn
run: corepack enable
# 4. Install dependencies (루트에서 워크스페이스 의존성 포함)
- name: Install dependencies
run: yarn workspaces focus --all --production
# 5. `core` 디렉토리로 이동하여 빌드 및 배포 작업 수행
- name: Build core package
working-directory: ./core
run: yarn build
# 6. Publish core to npm
- name: Publish core to npm (Dry Run)
working-directory: ./core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --dry-run