Merge branch 'develop' of https://github.com/smosco/react-player-plug… #17
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: 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: '18.13.0' | |
registry-url: 'https://registry.npmjs.org' | |
cache: 'yarn' | |
# 3. Enable Corepack for Yarn | |
- name: Enable Corepack for Yarn | |
run: corepack enable | |
# 4. Authenticate with npm | |
- name: Authenticate with npm | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
# 5. Install dependencies (루트에서 워크스페이스 의존성 포함) | |
- name: Install dependencies | |
run: yarn workspaces focus --all --production | |
# 6. `core` 디렉토리로 이동하여 빌드 및 배포 작업 수행 | |
- name: Build core package | |
working-directory: ./core | |
run: yarn build | |
# 7. Publish core to npm | |
- name: Publish core to npm | |
working-directory: ./core | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish |