Publish (Base) #9
Workflow file for this run
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 (Base) | |
on: | |
push: | |
tags: | |
- base-v* | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
# 태그에서 버전 추출 | |
- name: Extract version from tag | |
id: extract_version | |
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\/base-v/}" | |
# 루트 경로의 package.json 버전 업데이트 | |
- name: Update root version in package.json | |
run: | | |
npm version ${{ steps.extract_version.outputs.version }} --no-git-tag-version | |
# packages/base 경로의 package.json 버전 업데이트 | |
- name: Update base package version | |
run: | | |
cd packages/base | |
npm version ${{ steps.extract_version.outputs.version }} --no-git-tag-version | |
# GitHub Packages 배포 | |
- name: Publish to GitHub Packages | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}" > ~/.npmrc | |
cd packages/base | |
yarn publish --registry=https://npm.pkg.github.com/ | |
# npm 공용 레지스트리에 배포 | |
- name: Publish to npm | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" > ~/.npmrc | |
cd packages/base | |
yarn publish --registry=https://registry.npmjs.org/ |